三星s7换屏幕多少钱:用MATLAB软件解方程时遇到的问题。

来源:百度文库 编辑:神马品牌网 时间:2024/04/28 22:28:41
我用MATLAB解方程时遇到下面的错误:
首先我编了一个M方程文件,如下:
funtion Q=fun(T)
x=T(1);y=T(2);z=T(3);
Q=zeros(3,1);
Q(1)=x+y-z;
Q(2)=cos(x)+y^3+z-5;
Q(3)=4*x+2^y+log(z)-1;//(为了体现错误,我随便举了个能说明总是的简单例子)
保存后,我在command窗口中调用写到:

X=fsolve(@fun,[111],optimset('Display','off'))

然后在运行时,出现了以下显示的错误:

Warning: feval on script names will not work, or may work differently,
in a future version of MATLAB. To make your code insensitive to any change
and to suppress this warning message:
- Either change the script to a function.
- Or use eval instead of feval.
The script file in question is fun.
> In fsolve at 176
??? Attempt to execute SCRIPT fun as a function.

Error in ==> fsolve at 176
fuser = feval(funfcn{3},x,varargin{:});

谁能告诉我这是为什么?我刚开始用MATLAB,什么也不会,大家赐教,谢谢。
另外,我用的是MATLAB R2006a版本
在线等中,谢谢了!
谢谢了,我已经找出错误的原因了。