%%%%%%%%%%%%%%%%%% Example 2.9 %%%%%%%%%%%%%%%%%% % Discrete-Time Control Problems using % % MATLAB and the Control System Toolbox % % by J.H. Chow, D.K. Frederick, & N.W. Chbat % % Brooks/Cole Publishing Company % % September 2002 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % ---- Poles and system stability ---- % clear disp('Example 2.9') numG = [3 1.8 1.08] % generate G(z) as TF object denG = [1 -1.25 0.495 -0.0035 -0.1862] G = tf(numG,denG,1) % sampling period = 1.0 s disp('******>'), pause disp('Poles of G via pole command') xy2p(pole(G)); % poles of G via pole command disp('Poles of G via roots command') xy2p(roots(denG)); % poles of G via roots command %----------- poles and zeros --------------- figure ucircle, hold on % show unit circle in z-plane pzmap(G), hold off % draw pole-zero plot title('Example 2.9') set_xo_size % make larger X's ans O's disp('Plotting pole-zero locations') disp('******>'), pause %----------- delta response ---------- k = 0:80; y = impulse(G,k); % compute delta response of G(z) figure stem(k,y,'o:');grid % plot with dotted stems & o's xlabel('Time (s)') ylabel('Amplitude') title('Impulse response for Example 2.9') disp('Plotting impulse response') %%%%%%%%%%