fitting parabolic looking data to an exponential function

Hello,
I have data which looks like many different parabolas. I would like to fit each parabolic data set to an exponential function and determine if it is cubic quadratic or so.
I tried this
g = fittype('a*exp(b*x)');
f0 = fit(x,y,g,'StartPoint',[0,0,0]);
plot(x,y,'o')
hold on;
plot(f0(xx),'r-');
but it gives me a line. Perhaps something is wrong with my code. Any ideas? :)

Answers (1)

Nothing is wrong with your code, but I recommend using the built-in 'exp1' model instead, which doesn't require a start point.
f0 = fit(x,y,'exp1');

Categories

Asked:

on 7 Oct 2022

Answered:

on 7 Oct 2022

Community Treasure Hunt

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

Start Hunting!