Using exp2 in fit

15 Ansichten (letzte 30 Tage)
Elizabeth
Elizabeth am 8 Aug. 2014
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

Antworten (0)

Kategorien

Mehr zu Linear and Nonlinear Regression finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by