clspec1.m

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

M
21
字号
% CLSPEC1.M  Plot positive frequency spectrum of square wave%  The components are 2/(n pi); n odd. %  Plot 10 components of the discrete spectrum [f F]%   by calling function clptdscf%clearxunit='Hertz';          % Units of frequencyf=[0:1:10];             % Frequency scaleFn=zeros(1,11);		% Row vector of 11 elements% Frequency spectrumfor n=1:5		% Compute 5 positive components Fn(2*n-1)=2/((2*n-1)*pi); endFn=[0 Fn];		% Add the zero value%clptdscf(f,Fn,xunit)    % Call for plot%% Notice that the frequency increment is 1 from 0 to 10.% Modify the file to allow input the period of the pulse train%  and plot the spectrum in appropriately scaled units

⌨️ 快捷键说明

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