ex5_4.m

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

M
28
字号
%%%%%%%%%%%%%%%%%% Example 5.4 %%%%%%%%%%%%%%%%%%%   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                 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   ---- Output of a zero-order hold ----%cleardisp('Example 5.4')fs = 10, Ts = 1/fs;           % sampling frequency and periodt = [0:Ts:1]';                % time points from 0 to 1 se = sin(2*pi*t);              % 1-Hz signalfiguredplot(t,e), hold on           % sampled signalstairs(t,e)                   % ZOH outputtt = [0:0.01:1]';             % take tt as continuous timeec = sin(2*pi*tt);            % 1-Hz signalplot(tt,ec,'--'), hold off    % input sine wavexlabel('Time (s)')ylabel('Amplitude')title('Input, sampled signal, and ZOH output for Example 5.4')text(0.52,0.50,'ZOH output')text(0.47,-0.3,'Input')text(0.22,-0.7,'triangles are sampled signal')%%%%%%%%%%

⌨️ 快捷键说明

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