function Y = gaussian(X,M,S)

% y = gaussian(x,M,S)
% 
% x, y are [1 x N] or [N x 1] vectors.
% M, S are scalar mean and variance respectively.

% Liam Pedersen, CMU, 1998

D = sqrt(2*pi)*S;
E = -((X - M)/S).^2;
Y = exp(E/2)/D;