Problems with exponential fit.

1 次查看(过去 30 天)
Todd Gross
Todd Gross 2015-11-30
评论: Todd Gross 2015-12-1
I start with the following data:
x,y
0.0025,10
0.001818,100
0.001429,10000
And try to fit to rate=a*exp(bx) using the following code:
p=fit(x,y,'exp1');
p2=coeffvalues(p);
yfit=p2(1)*exp(p2(2)*x);
semilogy(x,y,'.',x,yfit)
and get a poor quality fit along with values that do not make sense. It really underestimates y for larger x.
Excel’s exponential fit seems reasonable.
Any ideas why the Matlab fit does not work. I was working with small x values so I multiplied by 1000 but it had no effect.

回答(1 个)

Walter Roberson
Walter Roberson 2015-12-1
  1 个评论
Todd Gross
Todd Gross 2015-12-1
Using transformed coordinates e.g. log x and log y with a polynomial fit often leads to values other than A for x=0 when y = A*exp(bx). I am interested in learning why exp1 fit does not work well in Matlab when the similar function in Excel seems to work well.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Curve Fitting Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by