Exponential Curve fit data a & b

1 vue (au cours des 30 derniers jours)
Martha
Martha le 19 Nov 2014
Réponse apportée : Martha le 19 Nov 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

Réponse acceptée

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

Plus de réponses (2)

Andrei Bobrov
Andrei Bobrov le 19 Nov 2014
use function coeffvalues

Martha
Martha le 19 Nov 2014
Thank you both for the answers, Martha

Catégories

En savoir plus sur Fit Postprocessing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by