reference:http://blog.csdn.net/shiwei408/article/details/7602324
Mahalanobis距离(马氏距离)的“哲学”解释
http://blog.csdn.net/jmy5945hh/article/details/20536929
马氏距离
[m,n] = size(data); % m代表维数;n代表数列矩阵点的个数
Dis = ones(m,n); %返回元素都为1的m*n矩阵
Cov = cov(data); %求矩阵的协方差
for i=1:m
for j=1:n
D(i,j)=sqrt((data(i,:)-data(j,:))*inv(Cov)*(data(i,:)-data(j,:))'); %mahal距离公式
end
end