📄 ex3_1.m
字号:
%%%%%%%%%%%%%%%%%% Example 3.1 %%%%%%%%%%%%%%%%%%% 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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ---- Series connection of two systems ----%% revised 05Jan02 JHC - eliminate k cleardisp('Example 3.1')Ts = 1;G1 = tf(0.02*[2 1.4],[1 -1.7 0.72],Ts) % G1 in TF form[zG1,pG1,kG1] = zpkdata(G1,'v') % zeros, poles, & gain of G1disp('******>'), pause pp = 0.9*exp(j*pi/5);pG2 = [pp; conj(pp); -0.8] % poles of G2 as column vectorG2 = zpk(-0.2,pG2,0.5,Ts) % G2 in ZPK formdisp('******>'), pause Tzpk = G2*G1 % series combination in ZPK form[zT,pT,kT] = zpkdata(Tzpk,'v') % zeros, poles, & gain from ZPK formdisp('******>'), pause xy2p(pT); % poles of T(z) in polar formTtf = tf(Tzpk) % series combination in TF formdt=[0:Ts:50]'; % discrete time sequenceyzpk = step(Tzpk,dt); % step response from ZPK formytf = step(Ttf,dt); % step response from TF formfigurestem(dt,yzpk,':','o'); grid % plot ZPK responsehold onplot(dt,ytf,'+'); % plot TF form over ithold off % step response of T(z) from TF formtitle('Impulse responses for Example 3.1')text(4.0,3.3,'O ==> ZPK form')text(4.0,3.1,'+ ==> TF form')xlabel('Time (s)')%%%%%%%%%%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -