Posted By


eiger_824 on 11/11/15

Tagged


Statistics


Viewed 22 times
Favorited by 0 user(s)

MahalanobisDistance


/ Published in: MatLab
Save to your folder(s)

asdfasdfasdfasd


Copy this code and paste it in your HTML
  1. function [d] = MahalanobisDistance(A,C)
  2. d = 0;
  3. C_prime = inv(C);
  4. aux = zeros(1,length(A));
  5. aux2 = 0;
  6. for i=1:length(A)
  7. for j=1:length(C)
  8. aux2 = aux2 + A(j)*C_prime(j,i);
  9. end
  10. aux(i)=aux2;
  11. end
  12.  
  13. for k=1:length(A)
  14. d = d + aux(k)*A(k);
  15. end
  16. end

URL: fasdfasdfasd

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.