function y = twoGaussians( params, x )

% Sum of two gaussians of the form
%   y = b1 * exp(-0.5*((x-x1)/a1)^2)
%     + b2 * exp(-0.5*((x-x2)/a2)^2)
% where params=[x1,x2,a1,a2,b1,b2]

% Get parameters
x1 = params(1);
x2 = params(2);
a1 = params(3);
a2 = params(4);
b1 = params(5);
b2 = params(6);

% Find function
y = b1*exp(-0.5*((x-x1)/a1).^2) + b2*exp(-0.5*((x-x2)/a2).^2);

end
