📄 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));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -