MATLAB求解非线性方程组用fsolve函数求解

问题描述:

MATLAB求解非线性方程组用fsolve函数求解
建立函数文件fxyz.m
function F=fxyz(X)
x=X(1);
y=X(2);
z=X(3);
F(1)=x^2+y^2+z^2;
F(2)=3*x+5*y+6*z;
F(3)=x-3*y-6*z-1;
给定初值[-1,1,-1],调用fsolve函数求方程的根
X1=fsolve('fxyz',[-1,1,-1]',optimset('Display','off'))
总是出现?Undefined function or method 'fsolve' for input arguments of type 'struct'.的提示,到底是为什么呢
1个回答 分类:综合 2014-11-23

问题解答:

我来补答
在我的机器上运行,没问题:
Optimizer appears to be converging to a minimum that is not a root:
Sum of squares of the function values is > sqrt(options.TolFun).
Try again with a new starting point.
X1 =
0.2295
0.0317
-0.1424
是不是你的Matlab版本低的原因?我用的是R2008a,Matlab7.6.0
 
 
展开全文阅读
剩余:2000