登录论坛

查看完整版本 : [MATLAB基础] 初学者 请教高手指点


591488385
2009-10-28, 15:27
按照书上程序输入:
t=0:0.001:2;
x=sin(2*pi*50*t)+sin(2*pi*100*t);
y=interp(x,4);
subplot(2,1,1);
stem(x(1:125));
subplot(2,1,2)
stem(y(1:250));


显示错误:
??? Attempt to execute SCRIPT interp as a function.

Error in ==> interp at 3
y=interp(x,4);

很多次都是这个错误,请指点一下。

ronymd
2009-10-29, 05:14
我为啥可以运行的呀??

591488385
2009-10-29, 09:19
我也是在m-file中编辑,然后run的啊。
应该不会是程序错误,书上的程序,难道我下的软件不全?或者在编辑之前还要其他操作?

haoxue
2009-10-31, 18:22
是啊,可以运行的,你再试试看