필터 지우기
필터 지우기

Exponential Curve fit data a & b

조회 수: 1 (최근 30일)
Martha
Martha 2014년 11월 19일
답변: Martha 2014년 11월 19일
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

채택된 답변

Torsten
Torsten 2014년 11월 19일
a=exp_curve.a;
b=exp_curve.b;
should give you the values of the fitting parameters.
Best wishes
Torsten.

추가 답변 (2개)

Andrei Bobrov
Andrei Bobrov 2014년 11월 19일
use function coeffvalues

Martha
Martha 2014년 11월 19일
Thank you both for the answers, Martha

카테고리

Help CenterFile Exchange에서 Fit Postprocessing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by