Mahalanobis distance matrix of an excel dataset
5 views (last 30 days)
Show older comments
Mmotevasseli(alex)
on 26 Feb 2019
Commented: Akira Agata
on 3 Mar 2019
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.
0 Comments
Accepted Answer
Akira Agata
on 27 Feb 2019
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);
2 Comments
Akira Agata
on 3 Mar 2019
In that case, maybe you have to implement mahalanobis-based pdist function by yourself using basic MATLAB function...
The definition of mahalanobis distance used in pdist function can be found in the pdist help page:
More Answers (0)
See Also
Categories
Find more on Spreadsheets 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!