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 Ansichten (letzte 30 Tage)
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).

Akzeptierte Antwort

Ameer Hamza
Ameer Hamza am 30 Apr. 2018
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 Kommentare

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by