matalab用lsqcurvefit拟合不出结果

5453522022-10-04 11:39:540条回答

matalab用lsqcurvefit拟合不出结果
函数
function f=expfn(x,xdate)
f=x(1)+x(2)*exp(-(xdate-x(3))/x(4));
程序
xdate=[18.1 20.8 23.2 25.6 28.4 30.4 32.9 35.7 37.9 41.1 44.2];
ydate=[1160 820 590 524 462 387 358 311 247 228 158];
plot(xdate,ydate);
x0=[100.0;2;-10;0.5];
[x,resnorm]=lsqcurvefit(@expfn,x0,xdate,ydate)
运行结果
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.
x =
476.8182
2.0000
-10.0000
0.5000
resnorm =
8.6582e+05
x和初值x0后面的无论参数怎么变都是一样的

已提交,审核后显示!提交回复

共0条回复

相关推荐

matalab运行时出现Cannot find an exact (case-sensitive) match for
matalab运行时出现Cannot find an exact (case-sensitive) match for 'FSPECIAL'.我用的是matalab r2011b
请问怎么修改?
会骗人的熊猫1年前1
changxin0821 共回答了19个问题 | 采纳率94.7%
把 FSPECIAL 改为 小写 fspecial 就可以了.matlab 区分大小写.
这段信息告诉你,大小写是区分的,找不到 实实在在的全部大写的 FSPECIAL.