Using exp2 in fit

15 visualizaciones (últimos 30 días)
Elizabeth
Elizabeth el 8 de Ag. de 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

Respuestas (0)

Categorías

Más información sobre Linear and Nonlinear Regression en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by