MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [求助]别人说是我的matlab有问题,求高手指点原因,不胜感激 (https://www.labfans.com/bbs/showthread.php?t=1884)

shipf2007 2008-03-26 15:58

[求助]别人说是我的matlab有问题,求高手指点原因,不胜感激
 
按照书中的例题写了以下语句
theta=0:0.01:2*pi
rho=sin(2*theta).*cos(2*theta)
polar(theta,rho,'k')
可却不能通过
错误提示为:
[COLOR="red"]??? Attempt to execute SCRIPT polar as a function.

Error in ==> polar at 3
polar(theta,rho,'k')[/COLOR]

还有下面的这个
x=linspace(0,2*pi,60)
y=sin(x)
z=cos(x)
t=sin(x)./(cos(x)+eps)
ct=cos(x)./(sin(x)+eps)
subplot(2,2,1)
plot(x,y)
subplot(2,2,2)
plot(x,z)
subplot(2,2,3)
plot(x,t)
subplot(2,2,4)
plot(x,ct)
错误提示为:
[COLOR="Red"]??? Attempt to execute SCRIPT subplot as a function.

Error in ==> subplot at 6
subplot(2,2,1)[/COLOR]
每次练习使用一个新的函数都提示错误。
我在基础学习板块求助,有好心人告诉我他们执行都是好的,说可能是我的matlab有问题。
我实在是不明白为什么,希望高人指点,不胜感激!
我的cpu是amd的

shiqiang 2008-03-27 12:33

有以下几种可能性,
一个是你的输入法,有时候中文状态和英文状态输入的符号在matlab中的含义是不同的,你可能尝试一下。
再者是你的运行方式,你是直接在命令窗口中运行这些程序的吗?你可以把这些程序复制到你的命令窗口中去执行一下,看看是不是还是这样的错误。
最后一个可能是之前有重复的变量,在运行命令之前输入clear以清楚内存中的变量。

dnping 2008-03-27 12:57

问题已经解决,暂时关闭,对于解决方案,祥见:
[url]http://www.labfans.com/showthread.php?t=2697[/url]


所有时间均为北京时间。现在的时间是 11:16

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.