% clear all,
 Psp = tf(1,[1/.1 1])*tf(1,[1 1]);          % slow pole
 Pldp = tf(1,[1 0.1 1])*tf(1,[1 1]);        % lightly damped pole
 Psz = tf([1/.1 1],[1 1])*tf(1,[1 1]);      % slow zero
 Pldz = tf([1 0.1 1],[1 2 1])*tf(1,[1 1]);  % lightly damped zero
 P = Psp;
%
% Reference model, a pair of critically damped poles and one fast pole
%
 Tref = tf(1,[1 sqrt(2) 1])*tf(1,[1/10 1]);
%
% Controller for which T=Tref
%
 C = zpk(feedback(Tref,-1)/P)
 zpk(P)
%
% Closed-loop transfer functions
%
 T = feedback(minreal(P*C),1);
 Td = feedback(P,C);
 Tc = feedback(C,P);
%
% Simulations
%
 figure(1)
 step(Td,linspace(0,20,1000))
 title('Disturbance response (step in $d(t)$)','Interpreter','latex','FontSize',20),
 figure(2)
 step(Tc,linspace(0,20,1000))
 title('Control signal response to step in $r(t)$','Interpreter','latex','FontSize',20),
 figure(3)
 step(T,linspace(0,20,1000))
 title('Reference response (step in $r(t)$)','Interpreter','latex','FontSize',20),