一个关于拟合工具箱的问题。

x:
0.5 1 1.5 2 2.5 3 4 5 6 7 8 9 10
f(x):
2.275 3.20125 4.151875 5.068125 5.273125 5.234375 4.825 4.365 3.56875 3.1175 2.636875 1.96625 1.29
f(x) = a*exp(b*x) + c*exp(d*x)
求大神帮忙拟合一下上面的数据用上面的函数,拟合求出a,b,c,d 顺便帮忙贴出拟合后函数的图,感谢
非常非常感谢啊

 Accepted Answer

lokerow
lokerow on 21 Nov 2022

0 votes

之所以会出现这个问题,原因是曲线拟合工具箱中给出的函数参数是按照科学计数法来给出的,我们在把相应的参数复制到命令窗口进行绘图的时候就会出现遗漏掉某些数值的个位或是十位数值。一般可以通过改变数值的显示方式来实现对数值的精确显示,具体的可以help。
此处你可以采用下面的这个函数进行绘图, 参数是我采用的显示方式format long;
f= (-2.504816130659028e+05)*exp((-0.344964134113171)*x) +(2.504816491189168e+05)*exp((-0.344944745061905)*x);
绘制出来如图1.不知道你明白了没有

More Answers (0)

Categories

Find more on Mathematics and Optimization in Help Center and File Exchange

Tags

Asked:

on 21 Nov 2022

Answered:

on 21 Nov 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!