ex2_12.m

来自「离散控制系统设计的MATLAB 代码」· M 代码 · 共 37 行

M
37
字号
%%%%%%%%%%%%%%%%% Example 2.12 %%%%%%%%%%%%%%%%%%%   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                 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   ---- System with 1 input and 2 outputs ----%cleardisp('Example 2.12')Ts = 0.05;G1 = tf(0.06059,[1  -0.9394],Ts);   % slower systemG2 = tf(0.2212,[1  -0.7788],Ts);    % faster systemG =  [G1; 1]*G2;                    % build 1-input/2-output system[zz,pp,kk] = zpkdata(G)             % get its zeros, poles, & gains%---- see contents of cell array for poles ----disp('contents of cell array pp are:')pp{:}                               % display contents of cell array pp%---------- step response -------dtime = 0:Ts:4;y = step(G,dtime);                  % compute step responses of y1 & y2figureplot(dtime,y(:,1),'o',dtime,y(:,2),'x');grid %plot y1 & y2title('Step responses for Example 2.12')xlabel('Time (s)')axis([0 4 0 1.1])text(0.3,1.05,'intermediate output y_2')text(1.22,0.65,'final output y_1')%%%%%%%%%%

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?