function [res]=gaussprob(X,C,M)
%C=diag(ones(1,length(X)));
l=length(X);
temp=(X-M)'*pinv(C)*(X-M);
NUM=exp(-temp/2)+eps;
E=eig(C);
[P,Q]=find(E>max(E)/2);
SE=E(P);
temp=1;
for i=1:1:length(SE)
temp= temp*SE(i);
end
DEN=((2*pi)^(l/2))*(abs(temp)^(1/2))+eps;
res=NUM/DEN;