frfit - frequency response fit
sys=frfit(w,fresp,order,weight) returns a bi-stable transfer function G(s)=sys=num/den, of of given order such that its frequency response G(w(i)) matches fresp(i), i.e. freq(num,den,%i*w) should be close to fresp. weight(i) is the weight given to w(i).
w=0.01:0.01:2;s=poly(0,'s'); G=syslin('c',2*(s^2+0.1*s+2), (s^2+s+1)*(s^2+0.3*s+1)); fresp=repfreq(G,w); Gid=frfit(w,fresp,4); frespfit=repfreq(Gid,w); bode(w,[fresp;frespfit])