

G=tf([10],[0.1 1 1]);
Gd=0.56*G;


K=zpk([-2],[0],5);
Kr=zpk([-80],[-8],1/10);

Unit=zpk([],[],1);
L=series(G,K);
T=feedback(L,Unit);
S=Unit-T;

figure(1);
bode(G);
title('Plant freq response')

figure(2);
bodemag(T);
hold on;
bodemag(S);
hold off;
title('S(s) and T(s)')

figure(3);
bode(K);
title('Controller freq response')

figure(5);
margin(L);

figure(6);
step(T*Kr);
title('Step reference response');

figure(7);
step(S*Gd);
title('Step disturbance response');


figure(8);
step(Kr*S*K);





