% program ch16ex4.m clc;close;hold off;echo on % illustrates use of the POLYID software % % first load the data load ch15ex3.mat % now fit a model % note this command will lead to an interactive session with user input required % [hm,hh,hl,K,theta,tau]=polyid(y1,u1,t1); close all; % hm contains the DFIR model % now compute the step response u=ones(1,60); t=0:.1:5.9; % convolve u with hm to get the step response ystep=conv(u,hm*.1); % only the first 60 points are useful ystep=ystep(1:60); plot (t,ystep); % compare with true step response hold on; sys=tf(1,[1 1]);sysd=c2d(sys,.1); [y,t]=step(sysd); plot(t,y);