I would like to know can anyone tell me how to implement transfer function a1s+a2/(b1s+b2) using Matlab meaning with for loop in the discrete form not using tf([a1 a2],[b1 b2]). For example if I want to implement a1/s I know I would do something like:
value(n)=value(n-1)+a1*fx*Ts;
where Ts is sampling frequency and fx is the function that needs to be integrated. for the a3*s I would do following:
output=value(n)-lastvalue(n);
lastvalue(n)=value(n);
But I am wondering how may I implement the generic (a1*s+a2)/(b1*s+b2)
Thanks