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

📄 clfex91.m

📁 Advanced Engineering Mathematics using MATLAB by Harman, Dabney, Richert,书中全部源码
💻 M
字号:
% CLFEX91.M Plot f(t) and F(f) for two pulses%   for Example 9.1clearclftstart=-3.0tfinal=3.0deltat=.02% First pulseA1=1			% Amplitudetp1s=-0.5		% Start of Pulsetp1f=0.5		% End of Pulset1=tstart:deltat:tp1s; 	%N1 pointsf1=zeros(size(t1));t2=tp1s:deltat:tp1f;	%N2 points, overlap at tp1sf2=A1* ones(size(t2));t3=tp1f:deltat:tfinal;	%N3 points, overlap at tp1ff3=zeros(size(t3));t=[t1 t2 t3];f=[f1 f2 f3];t2=[t1 tp1s];subplot(2,1,1),plot(t,f)axis([-2 2 0 1.5])hold on% SecondA2=0.5			% Amplitudetp2s=-1.0		% Start of Pulsetp2f=1.0		% End of Pulset1=tstart:deltat:tp2s; 	% N21 pointsf1=zeros(size(t1));t2=tp2s:deltat:tp2f;	%N22 points, overlap at tp1sf2=A2* ones(size(t2));t3=tp2f:deltat:tfinal;	%N23 points, overlap at tp1ff3=zeros(size(t3));t=[t1 t2 t3];f=[f1 f2 f3];t2=[t1 tp1s];subplot(2,1,1),plot(t,f,'--')T1=tp1f-tp1sT2=tp2f-tp2stitle('Two pulses and spectrum Figure 9.1')xlabel('t seconds')ylabel('Amplitude')hold off% Frequencydeltaf=.02xf=[-2:deltaf:2];xf=xf+(xf==0)*eps;	% Avoid divide by zeroTau1=T1/2F=(A1*T1)*sin(2*pi*xf.*Tau1)./(2*pi*xf.*Tau1);subplot(2,1,2),plot(xf,F)hold onaxis([-2 2 -.5 1.5])Tau2=T2/2F=(A2*T2)*sin(2*pi*xf.*Tau2)./(2*pi*xf.*Tau2);subplot(2,1,2),plot(xf,F,'--')gridxlabel('f hertz')ylabel('F(f)')hold off%%  This script could be generalized and improved by adding comments%

⌨️ 快捷键说明

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