%uppg2421

%a
G1a=tf([8],[1 2])
G2a=tf([2],[1 3 2])
G3a=tf([1],[0.2 1])

%Gka=G1*G2*G3

%margin(Gk)
grid on



%b
G1b=tf([1],[1 2 0])
G2b=tf([2],[1 4 2])
G3b=tf([1],[1])
%Gkb = G1*G2*G3
%margin(Gk)


%c
subplot(2,1,1)
title('step a')
Ha = feedback(G1a*G2a, G3a)
step(Ha)

subplot(2,1,2)
title('step b')
Hb = feedback(G1b*G2b, G3b)
step(Hb)