MATLAB: Mahalanobis distance matrix of an excel dataset

datasetmahalanobismatrix

i have an excel dataset with 7 column and 20 rows . i want to know how to compute and get the mahalanobis distance matrix in matlab.

Best Answer

Like this?
% Read data from Excel file
Data = xlsread('yourExcelFile.xlsx');
% Calculate pair-wise mahalanobis distance
D = pdist(Data,'mahalanobis');
% Convert to square form
D = squareform(D);
Related Question