% filter of system output and input function yf=filt(Y,t,fil) if fil==1 yf=[1 1]*[Y(t) Y(t-1)]'/2; else yf=[1 -1]*[Y(t) Y(t-1)]'/2; end