Borrar filtros
Borrar filtros

Exponential Curve fit data a & b

1 visualización (últimos 30 días)
Martha
Martha el 19 de Nov. de 2014
Respondida: Martha el 19 de Nov. de 2014
Hi, I'm trying to run a script automatically, and at some point I need to plot an exponential curve into a set of x and y data. I can do that in the 'Curve Fitting' APP and take the values of a and b from there. But I need to do it automatically like a process inside the script. I try this:
exp_curve=fit(x,y,'exp1');
And it returns to me the results in the Command Window as:
General model Exp1:
f2(x) = a*exp(b*x)
Coefficients (with 95% confidence bounds):
a = 584.6 (532.8, 636.4)
b = 0.004903 (0.004306, 0.005499)
However, it just print this on the Command Window, but I dont know how to take the values of a and b directly from the new variable created, because the variable 'exp_curve' doesnt return to me directly the results, and the type of variable is different is 1x1 cfit.
I will appreciate some help, Thank you, Martha

Respuesta aceptada

Torsten
Torsten el 19 de Nov. de 2014
a=exp_curve.a;
b=exp_curve.b;
should give you the values of the fitting parameters.
Best wishes
Torsten.

Más respuestas (2)

Andrei Bobrov
Andrei Bobrov el 19 de Nov. de 2014
use function coeffvalues

Martha
Martha el 19 de Nov. de 2014
Thank you both for the answers, Martha

Categorías

Más información sobre Fit Postprocessing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by