clear all; close all; s = tf('s'); wn = 1; zeta = 0.1; P = wn^2/(s^2 + 2*zeta*wn*s + wn^2); % plant to be controlled K = 1; % controller Tyd = 1/(1+P*K); % closed-loop system from disturbance d to output y figure(1); bode(K, 'b'); hold on; figure(2); nyquist(P*K, 'b'); % check for closed-loop stability hold on; figure(3); bodemag(Tyd, 'b'); % disterbance attenuation characteristic hold on; figure(4); impulse(Tyd, 'b', 30); % impulse disturbance response hold on; figure(5); step(Tyd, 'b', 30); % step disterbance response hold on;