% U3C, Pole Locations and Zeros
% 2nd-order system

clear all;
close all;



% 2 poles, 0 zero
% complex poles

set_a = [ 5, 10, 20 ];
set_b = [ 10, 20, 100 ];

p = 0;

for n = 1:length(set_a)
    for m = 1:length(set_b)

p = p+1;

figure(20+p)

a = set_a(n);
b = set_b(m);
K = a*a + b*b;

num = [ K ];
den = conv( [ 1 (a+j*b) ], [ 1 (a-j*b) ]);

G = tf( num, den );

subplot(2, 1, 1)

pzplot( G );
%axis('square')
%axis('equal')
axis( [ -25, 10, -110, 110 ] );
grid on;

% modify size
h = findobj(gca,'type','line');
for i = 1:length(h)
    set(h(i),'markersize',20) %change marker size
    set(h(i), 'linewidth',2)  %change linewidth
end


% time plot

t = 0:0.01:10;

subplot(2, 1, 2 )

step( G, t );
axis( [ 0, 1, -0.5, 1.5 ] );
% modify size

h = findobj(gca,'type','line');
for i = 1:length(h)
    set(h(i),'markersize',20) %change marker size
    set(h(i), 'linewidth',3)  %change linewidth
end


    end
end