Pairwise distance between 2 group of vectors (multidimensional)
% Find pair-wise SQUARE EUCLIDEAN distance
% or 'Weighted square euclidean' distance
% between each point in A and B
% For 2 vector a, b
% Euclidean distance= d = sum((a-b).^2)
% Weighted version = d = sum(wts.*(a-b).^2)
% ------------------------------
% Input:
% A= m_by_p, m points in p-dimension
% B= n_by_p, n points in p-dimension
% Wts = 1_by_p, defaut = [1 1 ...]
% Results:
% DD= m_by_n
% ------------------------------
% Facts: (a-b)^2= a^2+b^2-2ab
% ------------------------------
% trungd@okstate.edu, Feb 2011
% ------------------------------
% Ideal from: Piotr Dollar. [pdollar-at-caltech.edu]
See more detail at my blog: http://trunghuyduong.blogspot.com/2011/09/pair-wise-weighted-euclidean-distance.html
Cite As
Trung Duong (2024). Pairwise distance between 2 group of vectors (multidimensional) (https://www.mathworks.com/matlabcentral/fileexchange/33017-pairwise-distance-between-2-group-of-vectors-multidimensional), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
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.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |