共回答了14个问题采纳率:92.9%
function d = mahalanobis(X, Mu, C)
%MAHALANOBIS Mahalanobis distance.
% D = MAHALANOBIS(X, MU, C) returns the Mahalanobis distance between
% the length p vectors X and MU given the p by p covariance matrix
% C. If omitted, it is assumed that C is the identity matrix(单位矩阵/恒等矩阵)
% EYE(p). If either X or MU is an n by p matrix, D will be returned
% as an n by g matrix where n is the number of rows in X and g is
% the number of rows in MU where each entry i, j corresponds to the
% mahalanobis distance between row i of X and row j of MU. If MU is
% simply 0, it is treated as the origin from which Mahalanobis
% distance to X is calculated. C must be a positive, definite,
% symmetric matrix.
%
% The Mahalanobis distance between vectors X(i,:) and MU(j,:) is
% defined as:
%
%