Posted By

eiger_824 on 11/11/15


Tagged

asdfasdfasdf


Versions (?)

MahalanobisDistance


 / Published in: MatLab
 

URL: fasdfasdfasd

asdfasdfasdfasd

  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

Report this snippet  

You need to login to post a comment.