View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Euclidean distance

1.0 | 2 ratings Rate this file 7 Downloads (last 30 days) File Size: 1.15 KB File ID: #42064 Version: 1.0

Euclidean distance


wadzapi (view profile)


Calculate euclidean distance

| Watch this File

File Information

Calculate euclidean distance from every vector in matrix A to every in matrix B

MATLAB release MATLAB 7.13 (R2011b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
12 Jun 2013 Richard Crozier

John D'Errico's ipdm does this much better:

Comment only
04 Jun 2013 Florent Hennart

04 Jun 2013 Jan Simon

Jan Simon (view profile)

While Octave has "endfor", Matlab uses "end" for FOR loops.
BSXFUN ist faster than expanding the data by REPMAT.
SUM(Matrix, 2) replies a column vector, so I'd expect problems when you assign "dist_i" to a row of the result.
The missing pre-allocation slows down this function dramatically for larger inputs.

I think, this function cannot be used in its current state. Substantial changes in the code and a more detailed help section would be a a welcome improvement.

Contact us