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? :)

回答 (1 件)

Matt J
Matt J 2022 年 10 月 7 日

0 投票

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');

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

質問済み:

2022 年 10 月 7 日

回答済み:

2022 年 10 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by