
function g = Gaussian(x,mu,sigma)
 % Return the value of N(x;mu,sigma)

 D=length(x);
 
 P = (2*pi)^(D/2)*power(prod(sigma),1./D);
 s = 0;
 for i=1:D,
   if(sigma(i) ~= 0) s = s + ((x(i)-mu(i))^2)/sigma(i);
   end
end
 
if(P ~= 0) g = (1/P) * exp(-0.5*s);
else g=0;
end

