reinf2_14.m

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

M
31
字号
%%%%%%%%%%% Reinforcement Problem 2.14 %%%%%%%%%%%   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 to one cycle of a sine wave ---%cleardisp('Reinforcement Problem 2.14')numG = [0.3 0.4 0.5];                  % numerator of G(z)denG = [1 -1.3 0.455 0.0628 -0.037];   % denominator of G(z)Ts = 0.2                               % sampling periodG = tf(numG,denG,Ts)                   % create TF object G(z)dtime = [0:Ts:5]';                     % discrete time samples%---- input u2 ----u2 = 0*dtime;i1 = min(find(dtime>=2));for i=1:i1,  u2(i)=2*sin(pi*dtime(i));endy = lsim(G,u2,dtime);                  % compute response due to input ustem(dtime,y,'filled');grid            % plot response of G(z) due to uhold onplot(dtime,u2,'o')                     % plot inputhold offtext(2.4,0.6,'output')                 % add labels to plottext(0.9,-1.4,'input')title('Reinforcement Problem 2.14')%%%%%%%%%%

⌨️ 快捷键说明

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