%Mohamed Hassan NOR ID: 16210351
z=input('Enter zeros:. ')
p=input('Enter poles:. ')
k=input('Enter gain:. ')
% This below z an p values are the zeros and poles that were in our book.
%z=[-1+0i;1i;-1i;-0.5-0.866i;-0.5+0.866i];
%p=[0.7;0.5785+0.6894i;0.5785-0.6894i;0.5745+0.4821i;0.5745-0.4821i;0.4728+0.3694i;0.4728-0.3694i];
%k=0.0027;
[num,den]=zp2tf(z,p,k);
Hs=tf(num,den)
% bode(Hs),grid;
freqz(num,den)
% sys = tf(num,den,0.1,'Variable','z^-1') %Transfer function in z domain
% bode(sys)
% Pole zero figure building .....
figure('name','Z_plane','position',[185 99 570 450]);
zplane(num,den)
set(gca,'color',[0.95,0.88,0.89]);
title('poles and zeros');