filter
Linear discrete filter.
[y,z]=filter(b,a,x)
[y,z]=filter(b,a,x, zi)
Inputs
a The vector for auto-regressive 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.


Description
Solves the discrete dynamic system
    a[1]y[i]+a[2]y[i-1]..a[na]y[i-na+1]=b[1]x[i]+b[2]x[i-1]+..b[nb]x[i-nb+1];
Example
The ordinary differential equation dy/dx+y=1 can be discretized as (1+h)y[i]-y[i-1]=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);