Effacer les filtres
Effacer les filtres

help on fitting a curve

1 vue (au cours des 30 derniers jours)
Leah
Leah le 10 Juil 2012
how do you fit data with a peak using a Gaussian curve? If there are two peaks but you only want to fit a curve within a specific range asked by the user, how do you fit a curve?

Réponses (1)

Wayne King
Wayne King le 10 Juil 2012
Modifié(e) : Wayne King le 10 Juil 2012
Do you have the curve fitting toolbox?
If so, cftool has a Gaussian option built in.
Or from the command line:
x = (-3:0.01:3)';
y = exp(-x.^2/2);
yfit = fit(x,y,'gauss1');
  2 commentaires
Leah
Leah le 10 Juil 2012
what happens if i have a dimention of double for the x and double for the y, doing that doesn't work is there any other way?
Wayne King
Wayne King le 11 Juil 2012
Do you mean datatype double-precision? why not, the example I have above uses double-precision vectors.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Linear and Nonlinear Regression dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by