gausspdf.m

来自「一本关于dsp的原著教材」· M 代码 · 共 27 行

M
27
字号
function [z] = gausspdf(x,mu,sigma);% GAUSSPDF  Values of the Gaussian probability density%           function%%    GAUSSPDF(X,MU,SIGMA) returns the likelihood%    of the point or set of points X with respect to%    a Gaussian process with mean MU and covariance%    SIGMA. MU is a 1*D vector (where D is the dimension%    of the process), SIGMA is a D*D matrix%    and X is a N*D matrix where each row is a%    D-dimensional point.%%    See also MEAN, COV, GLOGLIKE[N,D] = size(x);if (min(N,D) == 1), x=x(:)'; end;invSig = inv(sigma);mu = mu(:)';x = x-repmat(mu,N,1);z = sum( ((x*invSig).*x), 2 );z = exp(-0.5*z) / sqrt((2*pi)^D * det(sigma));

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?