User`s guide
Parametric Fitting
3-57
General Equation: Gaussian Fit with Exponential Background
This example fits two poorly resolved Gaussian peaks on a decaying
exponential background using a general (nonlinear) custom model. To get
started, load the data from the file
gauss3.mat, which is provided with the
toolbox.
load gauss3
The workspace now contains two new variables, xpeak and ypeak:
•
xpeak is a vector of predictor values.
•
ypeak is a vector of response values.
Import these two variables into the Curve Fitting Toolbox and accept the
default data set name
ypeak vs. xpeak.
You will fit the data with the following equation
where a
i
are the peak amplitudes, b
i
are the peak centroids, and c
i
are related
to the peak widths. Because there are unknown coefficients included as part of
the exponential function arguments, the equation is nonlinear. Therefore, you
must specify the equation using the General Equations pane of the Create
Custom Equation GUI. This pane is shown below for y(x).
yx() ae
bx–
a
1
e
xb
1
–
c
1
--------------
2
–
a
2
e
xb
2
–
c
2
--------------
2
–
++=
Two Gaussian peaks on an
exponential background.
By default, the coefficients are
unbounded and have random
starting values between 0 and 1.