Using exp2 in fit
4 次查看(过去 30 天)
显示 更早的评论
Hi there,
I managed to fit my data to exp2 pretty nicely using the code:
f1 = fit(z,Tz,'exp2');
I wanted to try something else, by fitting the same data into the sum of a linear and exponential function because I realized my first exponential in the 'exp2' fit is essentially linear, i.e. a*x + b*exp(c*x) + d
I defined the model as such, but the fit gave me a completely different line: model = @(a, b, c, d, x) a*x + b*exp( c*x ) + d; f2 = fit( z, Tz,model);
I have a feeling it has to do with my startpoint, reason being that when I tried: model = @(a, b, c, d, x) a*exp(b*x) + c*exp( d*x ); f2 = fit( z, Tz,model); I was getting some bad fitting as well.
So I guess my question is, how does fit(z, Tz, 'exp2') , figure out the startpoint and produces such a nice fit to my data?
Thanks! Elizabeth
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear and Nonlinear Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!