d2 = mahal(Y, X)
mahal returns the squared Mahalanobis distance of each observation in Y to the reference sample matrix X.
X and Y must have the same number of columns. X must have more rows than columns.
X = [1 2; 2 3; 3 5; 4 4; 5 7; 6 8];
Y = [3 4; 5 6; 8 10];
d2 = mahal(Y, X)
| Version | Description |
|---|---|
| 2.0.0 | initial version |