Gaussian1_1D.m 327 B

123456789
  1. function y = Gaussian1_1D(A, xdata)
  2. % Gaussian function
  3. % A: parameters of the Gaussian function
  4. % A(1) = a1, A(2) = mu1, A(3) = sigma1, A(4) = b
  5. % y = a1 * exp( -((x - mu1) ^ 2) / (2 * sigma1 ^ 2 ) ) + b
  6. % xdata: a vector which contains x values
  7. y = A(1) * exp( -((xdata - A(2)) .^ 2) / (2 * A(3) ^ 2) ) + A(4);