mahal
Squared Mahalanobis distance to reference samples.
📝Syntax
d2 = mahal(Y, X)
📄Description

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.

💡Examples
X = [1 2; 2 3; 3 5; 4 4; 5 7; 6 8];
Y = [3 4; 5 6; 8 10];
d2 = mahal(Y, X)
🔗See Also
covpdist2pca
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub