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).
引用
Quan Wang (2024). Pair-wise Euclidean Distance Matrix (https://www.mathworks.com/matlabcentral/fileexchange/45968-pair-wise-euclidean-distance-matrix), MATLAB Central File Exchange. に取得済み.
MATLAB リリースの互換性
作成:
R2013b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linuxカテゴリ
Help Center および MATLAB Answers で Statistics and Machine Learning Toolbox についてさらに検索
タグ
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!