% Solution of Problem 2.18

num=[1 -3 5 2 0];
den=[2 0 5 -3 1 -2 3 -1];

% (a) Zeros and poles
disp('2.18(a) - zeros [z] and poles [p]')
[zo,po,ko]=tf2zp(num,den);
disp('Zeros:')
zo
disp(' ')
disp('Poles')
po

% (b) Inverse Z-transform
disp(' ')
disp('2.18(b) - inverse Z-transform - fraction expansion coefficients')
[r,p,k]=residue(num,den);
r

% (c) Closed-loop zeros and poles
disp(' ')
disp('2.1(c) - closed loop zeros and poles')
[numc,denc]=feedback(num,den,1,1,-1);
[zc,pc,kc]=tf2zp(numc,denc);
disp(' ')
disp('Closed-loop zeros')
zc
disp(' ')
disp('Closed-loop poles')
pc