Pair-wise Euclidean Distance Matrix

Version 1.2.0.0 (2.62 KB) by Quan Wang
Computing the distance matrix without loops
733 Downloads
Updated 20 May 2014

View License

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 Linux
Categories
Find more on Statistics and Machine Learning Toolbox in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.2.0.0

Changed the description.

1.1.0.0

Added distance matrix from X to Y.

1.0.0.0