正在加载图片...
Note: this function creates a matri rows= length(t)and columns=(length(K )-1)/2 Copyrigth(c)1996 by Prentice-Hall, Inc =2. w0=1: end length(kn) if rem(nk-1, 2)I(nk==1) erro( Number of element in K must be odd and greater than 1) n=0.5*(nk-1); highest harmonic nwo=wo*(1: n); harmonic frequencies ko=kn(n+1); average value kn=kn(n+2: nk), positive frequency coefs y=ko+2*(real(exp(*t(: )*nwo)*kn)) 遵照所需的语法,我们得到: >>n=-N: n: harmonic index >>Fna=j*5 /(pi*n);% actual Fourier series coefficients >>Fna(N+1)=5; poke in average value >>t=linspace(0,. 4);% time points to evaluate functions >>w=2*pi/T; fundamental frequency >>f-fseval(Fn, t, wo); evaluate approximated Fourier series >>fa=fseval( Fna, t, wo) evaluate actual fourier series >>plot(t, f, t, fa) plot resul 0.2% Note: this function creates a matrix of size: % rows = length(t) and columns = (length(K)-1)/2 % Copyrigth (c) 1996 by Prentice-Hall,Inc. if nargin==2, wo=1; end nk=length(kn); if rem(nk-1, 2) | (nk==1) erro(‘ Number of element in K must be odd and greater than 1 ‘) end n=0.5*(nk-1);% highest harmonic nwo=wo*(1 : n); % harmonic frequencies ko=kn(n+1); % average value kn=kn(n+2 : nk) ‘; % positive frequency coefs y=ko+2*(real(exp(j*t( : )*nwo)*kn))' ; 遵照所需的语法,我们得到: >>n=-N : N; % harmonic index >>Fna=j*5 ./ (pi*n); % actual Fourier series coefficients >>Fna(N+1)=5; % poke in average value >>t=linspace(0 , .4); % time points to evaluate functions >>wo=2*pi/T; % fundamental frequency >>f=fseval(Fn, t, wo); % evaluate approximated Fourier series >>fa=fseval(Fna, t, wo); % evaluate actual Fourier series >>plot(t, f, t, fa) % plot results for comparison 0 0.1 0.2 0.3 0.4 -2 0 2 4 6 8 10 12
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有