[y,z]=filter(b,a,x)
[y,z]=filter(b,a,x, zi)
Inputs  
a 
The vector for autoregressive part of the filter. 
b 
The vector of moving average part of the filter. 
x 
The vector of input. 
zi 
A vector of size max(na, nb) to specify the 'initial conditions', typically the second output from a previous call to the function.

Outputs  
y 
The vector of outputs. 
z 
The terminal state of the discrete dynamical system used to implement the filter. 
a[1]y[i]+a[2]y[i1]..a[na]y[ina+1]=b[1]x[i]+b[2]x[i1]+..b[nb]x[inb+1];
dy/dx+y=1
can be discretized
as (1+h)y[i]y[i1]=h
for a step size of h
. The function filter
may
used to solve this problem as follows:
>>x=ones(100,1); >>b=.01; >>a=[1.01 1] >>y=filter(b,a,x);