clear; sample=.1; % Vary the size of the step input here step_mag=.25; % Vary the noise magnitude here noisemag=0; noise=(noisemag)^2; sim('id_p3_mod',20) figure(1) subplot(211) plot(t,x1,'o') subplot(212) plot(t,u,'x') % Put in an algorithm to find a transfer function from phi and Y matrices here % Make sure to use the variables Y, phi, theta as appropriate, and name tbe % transfer function sys % This will plot a step response due to the step of the magnitude above % (by linear property mutliply system by the magnitude, since the step % function automatically applies a step size of 1) figure(2) step(step_mag*sys,20) % Compare y and here figure(3) plot(t,[Y,phi*theta]) title(sprintf('Error %g %%',norm(Y-phi*theta)/norm(Y)))