Standard Library function that fits aGaussian curve through a data set.
y A real vector containing the values of the dependent variable. Should be the same length as x.
These estimated parametersalong with the constant, linear, and quadratic coefficients of the straight line polynomialare sent to the CURVEFIT function as trial coefficients of the Gaussian function. CURVEFIT uses a nonlinear least-squares method to fit a function with an arbitrary number of parameters. Any nonlinear function can be fitted as long as the partial derivatives of the function are known or can be approximated.
The peak or minimum of the Gaussian function returned will be located at the index of the largest or smallest value, respectively, in the y vector.