📄 ex2_5.m
字号:
%%%%%%%%%%%%%%%%%% Example 2.5 %%%%%%%%%%%%%%%%%%% 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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ---- Response due to complex poles on the unit circle ----%cleardisp('Example 2.5')Ts = 1;numG = [1 0.5]; % numerator of G(z)denG = conv([1 -exp(i*pi/3)],[1 -exp(-i*pi/3)]); % denominator of G(z)G1 = tf(numG,denG,Ts) % build G(z) as TF object for Ts = 1[y1,k1] = impulse(G1,20); % compute response and time vectorfigurestem(k1,y1,'filled');grid % plot response for Ts = 1 stitle('Example 2.5: Sampling period = 1.0 s')xlabel('Time (s)')ylabel('Amplitude')disp('Plotting impulse response with a sampling time of 1.0 s')disp('******>'), pause%------ change sampling period to Ts = 0.5 s --------Ts = 0.5;G05 = tf(numG,denG,Ts) % rebuild G(z) as TF object for Ts = 0.5[y05,k05] = impulse(G05,20); % compute response and time vectorfigurestem(k05,y05,'filled');grid % plot response for Ts = 0.5title('Example 2.5: Sampling period = 0.5 s')xlabel('Time (s)')ylabel('Amplitude')disp('Plotting impulse response with a sampling time of 0.5 s')%%%%%%%%%%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -