Effacer les filtres
Effacer les filtres

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

1 vue (au cours des 30 derniers jours)
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).

Réponse acceptée

Ameer Hamza
Ameer Hamza le 30 Avr 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 commentaires
Walter Roberson
Walter Roberson le 1 Mai 2018
Flimg = double(YourMatrix) ;
Out = cast(Flimg.*G(Flimg), class(YourMatrix)) ;

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by