在学习matlab非线性lsqcurvefit 拟合的时候,无法调试出结果,求大神帮忙指导
具体的报错提示如下:
Local minimum possible.
lsqcurvefit stopped because the final change in the sum of squares relative to
its initial value is less than the default value of the function tolerance.
<stopping criteria details>
我的代码如下:
t=[1790:10:2000]';
x=[3.9,5.3,7.2,9.6,12.9,17.1,23.2,31.4,38.6,50.2,62.9,76.0,92.0,106.5,123.2,131.7,150.7,179.3,204.0,226.5,251.4,281.4]';
fun=@(cs,td)cs(1)./(1+(cs(1)/3.9-1)*exp(-cs(2)*(td-1790)));
cs=lsqcurvefit(fun,rand(2,1),t,x,zeros(2,1));
最佳答案
你这个拟合是有结果的:
Local minimum possible.
lsqcurvefit stopped because the final change in the sum of squares relative to
its initial value is less than the default value of the function tolerance.
<stopping criteria details>
cs =
342.4368
0.0274
要这样改下:把最后一句后的分号去掉,就会显示结果。
其他回答
暂无其它回答!