function y = gaussian(m,v,t) % GAUSSIAN y = gaussian(m,v,t) Gaussian distribution function % Version of 11/18/92 % Distribution function for X ~ N(m, v) % m = mean, v = variance % t is a matrix of evaluation points % y = P(X<=t) (a matrix of the same dimensions as t) u = (t - m)./sqrt(2*v); if u >= 0 y = 0.5*(erf(u) + 1); else y = 0.5*erfc(-u); end