MATLAB File Help: cv.Mahalanobis Index
cv.Mahalanobis

Calculates the Mahalanobis distance between two vectors

d = cv.Mahalanobis(v1, v2, icovar)

Input

Output

The function Mahalanobis calculates and returns the weighted distance between two vectors:

d(v1,v2) = sqrt( sum_{i,j} [icovar(i,j) * (v1(I) - v2(I)) * (v1(j) - v2(j))] )

The covariance matrix may be calculated using the cv.calcCovarMatrix function and then inverted using the cv.invert function (preferably using the 'SVD' method, as the most accurate).

See also