%% Fit Gaussian Models Using the fit Function
% This example shows how to use the fit function to fit a Gaussian model to data.
% The Gaussian library model is an input argument to the fit and fittype functions. Specify the model type gauss followed by the number of terms, e.g., 'gauss1' through 'gauss8' .
%% Fit a Two-Term Gaussian Model
% Load some data and fit a two-term Gaussian model.

[x,y] = titanium;
f = fit(x.',y.','gauss2')
plot(f,x,y)

% Copyright 2015 The MathWorks, Inc.