ex5_2.m

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

M
41
字号
%%%%%%%%%%%%%%%%%% Example 5.2 %%%%%%%%%%%%%%%%%%%   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                 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   ---- Aliasing in the time domain ----%cleardisp('Example 5.2')fs = 10, Ts = 1/fs              % sampling at 10 Hzt = [0:Ts:1]';                  % time points from 0 to 1 sece_1 = sin(2*pi*t);              % 1 Hz signale_2 = sin(18*pi*t+pi);          % 9 Hz signale_3 = sin(22*pi*t);             % 11 Hz signal%--------------- plot three sampled signals ---------figuredplot(t,e_1);grid               % plot the sampled 1 Hz signal hold ondplot(t,e_2)                    % plot the sampled 9 Hz signal dplot(t,e_3)                    % plot the sampled 11 Hz signal hold offxlabel('Time (s)')ylabel('Amplitude')title('Sampled signals e_1^*(t),e_2^*(t),e_3^*(t) for Example 5.2')%--------------- plot three continuous-time signals ---------tt = [0:0.01:1]';               % consider tt as continuous timefigureplot(tt,sin(2*pi*tt),'-');grid;          % solid curve   hold on   plot(tt,sin(18*pi*tt+pi),'--')           % dashed curveplot(tt,sin(22*pi*tt),'-.')              % dash-dot curveplot(t,e_1,'*')                          % plot sample valueshold offxlabel('Time (s)')ylabel('Amplitude')title('Continuous-time signals e_1(t), e_2(t), e_3(t) for Example 5.2')%%%%%%%%%%

⌨️ 快捷键说明

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