ex8_14.m

来自「Advanced Engineering Mathematics using M」· M 代码 · 共 27 行

M
27
字号
% EX8_14.M Plot frequency response of a system with pulse input%  y'' +3 y' +2 y=P(t);  Pulse width is tau = 1 second.w=[-4*pi:.1:4*pi];              % Frequency rangew=w + eps;                      % Avoid a divide by zeroY=zeros(size(w));P=zeros(size(w));H=zeros(size(w));%A=1;                            % Pulse amplitudetau =1;                         % Pulse width in secondsalp=w*tau/2;P=(A*tau)*abs((sin(alp))./alp);	% Transform of pulseH=1./(sqrt(w.^4+w.^2+4));       % Transform of systemY=P.*H;                         % Transform of output% clfsubplot(2,1,1),plot(w,P,'-',w,H,'--')axis([-15 15 0 1.1])title('Spectrum of a pulse and the system - Figure 8.12')xlabel('Frequency in radians/sec')ylabel('F(w) and H(w)')legend('Pulse','System')subplot(2,1,2), plot(w,Y);axis([-15 15 0 1])xlabel('Frequency in radians/sec')ylabel('Output Y(w)')

⌨️ 快捷键说明

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