Pairwise distance between 2 group of vectors (multidimensional)

Find pair-wise WEIGHTED SQUARE EUCLIDEAN distance distance between 2 group of vectors
360 Downloads
Updated 26 Sep 2011

View License

% 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
Created with R14
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.0.0.0