MATLAB File Help: cv.Mahalanobis | Index |
Calculates the Mahalanobis distance between two vectors
d = cv.Mahalanobis(v1, v2, icovar)
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).