paultant
2009-10-18, 15:27
M 文件:function y=myfun(x,xdata)
y=x(1)+x(2)./xdata+x(3).*xdata;
然后在命令窗口输入:
xdata=[3.220 4.896 6.326 7.763 9.227 10.38];
ydata=[0.00179 0.00176 0.00192 0.00228 0.00247 0.0063];
x0=[0 0 0];
[x,resnorm]=lsqcurvefit(@myfun,x0,xdata,ydata)
结果出现:
Optimization terminated: first-order optimality less than OPTIONS.TolFun,
and no negative/zero curvature detected in trust region model.
请教高手怎么解决?
y=x(1)+x(2)./xdata+x(3).*xdata;
然后在命令窗口输入:
xdata=[3.220 4.896 6.326 7.763 9.227 10.38];
ydata=[0.00179 0.00176 0.00192 0.00228 0.00247 0.0063];
x0=[0 0 0];
[x,resnorm]=lsqcurvefit(@myfun,x0,xdata,ydata)
结果出现:
Optimization terminated: first-order optimality less than OPTIONS.TolFun,
and no negative/zero curvature detected in trust region model.
请教高手怎么解决?