|On this page…|
The Gaussian model fits peaks, and is given by
where a is the amplitude, b is the centroid (location), c is related to the peak width, n is the number of peaks to fit, and 1 ≤ n ≤ 8.
Gaussian peaks are encountered in many areas of science and engineering. For example, Gaussian peaks can describe line emission spectra and chemical concentration assays.
In the Curve Fitting app, select Gaussian from the model type list.
You can specify the following options:
Choose the number of terms: 1 to 8.
Look in the Results pane to see the model terms, the values of the coefficients, and the goodness-of-fit statistics.
(Optional) Click Fit Options to specify coefficient starting values and constraint bounds, or change algorithm settings.
The toolbox calculates optimized start points for Gaussian models, based on the current data set. You can override the start points and specify your own values in the Fit Options dialog box.
Gaussians have the width parameter c1 constrained with a lower bound of 0. The default lower bounds for most library models are -Inf, which indicates that the coefficients are unconstrained.
For more information on the settings, see Specifying Fit Options and Optimized Starting Points.
Specify the model type gauss followed by the number of terms, e.g., 'gauss1' to 'gauss8'.
For example, to load some data and fit an eight-term Gaussian model:
load enso; f = fit(month,pressure,'gauss8') plot(f,month,pressure)
If you want to modify fit options such as coefficient starting values and constraint bounds appropriate for your data, or change algorithm settings, see the table of additional properties with NonlinearLeastSquares on the fitoptions reference page.