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

Euclidean distance




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

Richard Crozier

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


Comment only
04 Jun 2013 Florent Hennart

Florent Hennart

04 Jun 2013 Jan Simon

Jan Simon

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