%
%  This routine plots the magnitude of transfer functions
%
%  inputs: r = root of polynomial

function homework9;

poles = [-1+10j -1-10j];
zeros = [0 15j -15j];

w = linspace(-30,30,10000);

H = tf(poly(zeros),poly(poles))
p = pole(H)
z = zero(H)
[B,A] = tfdata(H,'v');
polar_H = freqs(B,A,w);
scale = 1/(max(abs(polar_H)));
figure; plot(w,scale*abs(polar_H),'-','Linewidth',2); grid; ylabel('|H(j\omega)|'); xlabel('\omega (rad/sec)');

