Pair-wise Euclidean Distance Matrix
Version 1.2.0.0 (2.62 KB) by
Quan Wang
Computing the distance matrix without loops
This is a very simple function to compute pair-wise Euclidean distances within a vector set, from between two vector sets. Although simple, it is very useful. Using loops will be too slow.
D=distanceMatrix(X), where X is N*d data, and D is N*N distance matrix.
or D=distanceMatrix2(X,Y).
Cite As
Quan Wang (2024). Pair-wise Euclidean Distance Matrix (https://www.mathworks.com/matlabcentral/fileexchange/45968-pair-wise-euclidean-distance-matrix), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2013b
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Statistics and Machine Learning Toolbox in Help Center and MATLAB Answers
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.