Mahalanobis function for matrices

1 view (last 30 days)
Mohammad Amin Javadi
Mohammad Amin Javadi on 12 Feb 2016
I have two 150*4 matrices. I do not want to use the command mahal(A,B) to find the distance. Instead, I want to use the following: function mahaDist = Mahalanobisfunction(x,y) mahaDist = (x-y)'*(inv(cov(x,y)))*(x-y); end . Why does it give me error? (instead of x and y I put my matrices)

Answers (0)

Categories

Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!