⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex2_7.m

📁 离散控制系统设计的MATLAB 代码
💻 M
字号:
%%%%%%%%%%%%%%%%%% Example 2.7 %%%%%%%%%%%%%%%%%%%   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                 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   ---- Step response from G(z) ----%cleardisp('Example 2.7')numG = [2 -2.2 0.56]                   % create G(z)denG = [1 -0.6728 0.0463 0.486]        % ...as TF objectG = tf(numG,denG,1)                    % ...with unit sampling periodnumGstep = [numG 0]                    % add a zero at z=0 to G(z)denGstep = conv(denG,[1 -1])           % add a pole at z=1 to G(z)Gstep = tf(numGstep,denGstep,1)        % create zG(z)/(z-1) as TF objectdtime = [0:50];                        % define discrete time samplesyi = impulse(Gstep,dtime);             % step response via impulse cmdfiguresubplot(2,1,1)stem(dtime,yi,'filled');grid           % plot impulse response of Gstep(z)title('Example 2.7: step response via impulse cmd')[ys,ks] = step(G,dtime);               % step response via step commandsubplot(2,1,2)stem(dtime,ys,'filled');grid           % plot step response of G(z)title('step response via step command')xlabel('Time (s)')disp('DC gain is:')disp(dcgain(G))                        % DC gain of G(z)%%%%%%%%%%

⌨️ 快捷键说明

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