matlab达人替俺看看,,

来源:百度知道 编辑:UC知道 时间:2024/09/25 17:13:55
clf;
N=8;n1=-N:-1;
c1=-4*j*sin(n1*pi/2)/pi^2/n1^2;
c0=0;
n2=1:N;
c2=-4*j*sin(n2*pi/2)/pi^2/n1^2;cn=[c1 c0 c2];n=-N:N;
subplot(2,1,1);Stem(n,abs(cn));ylabel('Am of CN');subplot(2,1,2);
Stem(n,angle(cn));ylabel('phase of CN');xlabel('\omega/\omega0');
以上是一个模拟连续周期信号的傅里叶级数的代码,但就是图出不来,不知道怎么办?有哪位大哥知道怎么改吗?

clf;
N=8;n1=-N:-1;
c1=-4*j*sin(n1*pi/2)/pi^2./n1.^2;
c0=0;
n2=1:N;
c2=-4*j*sin(n2*pi/2)/pi^2./n1.^2;cn=[c1 c0 c2];n=-N:N;
subplot(2,1,1);Stem(n,abs(cn));ylabel('Am of CN');subplot(2,1,2);
stem(n,angle(cn));ylabel('phase of CN');xlabel('\omega/\omega0');

主意
^和.^以及/和./的区别