Using exp2 in fit
11 views (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!