www.pudn.com > trackingdemos.zip > GAUSSPDF.M


% GAUSSPDF.M   Calculate Gaussian (normal) pdf value 
%  
% function y=gausspdf(x,mean,cov) 
% 
% input parameters: 
%    x     ----- the pdf value to be evaluated 
%    mean  ----- the mean of Gaussian RV 
%    cov   ----- the covariance of Gaussian RV 
% output parameters: 
%    y     ----- the value of the corresponding pdf evaluated at x 
function y=gausspdf(x,mean,cov) 
% make the inputs x and mean be column vectors 
if size(x,2)>1 
    x=x'; 
end 
if size(mean,2)>1 
    mean = mean'; 
end 
 
y=exp(-0.5*((x-mean)'*inv(cov)*(x-mean)))/sqrt(det(2*pi.*cov));