I want to fit some data x and y to a specific equation f(x) and then estimate this fitted data as g(x)=1/f(x) ?

2 ビュー (過去 30 日間)
x=[0,0.5,1,1.5,2,2.5];
y=[1,0.8,0.6,0.4,0.2,0];
F(x)= exp[(a*x^2)+(b*x)+c], where a,b,c are not known to me
after fitting this data to this equation i want to get g(x)=1/f(x). The picture attached below demonstrates what we are trying to do. Figure A shows x and y fitted to f(x) and figure B shows estimated g(x)=1/f(x).

採用された回答

Ameer Hamza
Ameer Hamza 2018 年 4 月 30 日
Using Curve Fitting toolbox , it is quite easy to fit the curve.
fitFunction = fittype('exp(a*x.^2+b*x+c)');
coff = fit(x', y', fitFunction);
a = coff.a;
b = coff.b;
c = coff.c;
  18 件のコメント
Walter Roberson
Walter Roberson 2018 年 5 月 1 日
Flimg = double(YourMatrix) ;
Out = cast(Flimg.*G(Flimg), class(YourMatrix)) ;
j.D
j.D 2018 年 5 月 2 日
Yeah that works , thanks.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by