cuishijie 发表于 2012-6-4 15:09

Strings passed to EVAL cannot contain function declarations

我用matlab打
function y=sf1(t,w)
y=(abs(t)<=1).*(1-abs(t)).*exp(-j*w*t);


w=linspace (-6*pi,6*pi,512);
N=length(w);
F=zeros(1,N);
for k=1:N
F(k)=quad('sf1',-1,1,[],[],w(k));
end
figure(1);
plot(w,real(F));
xlabel('\omega');
ylabel('F(j\omega)','rotation',0);
运行结果是显示Strings passed to EVAL cannot contain function declarations
求大神解答
题目是:2.试用数值方法近似计算三角波信号的频谱


页: [1]
查看完整版本: Strings passed to EVAL cannot contain function declarations