Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fit exponential curve through data points in Matlab

Tags:

matlab

Having data of an exponential decay available, I would like to fit a curve through it. How can I do that in Matlab?

like image 880
Ingo Avatar asked Nov 23 '25 12:11

Ingo


2 Answers

Try this:

ft=fittype('exp1');
cf=fit(time,data,ft)

This is when time and data are your data vectors; time is the independent variable and data is the dependent variable.

This will give you the coefficients of the exponential decay curve.

like image 124
Adiel Avatar answered Nov 26 '25 23:11

Adiel


If by fit you mean least squares, you should try lsqcurvefit

like image 41
user389419 Avatar answered Nov 26 '25 23:11

user389419



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!