File Exchange

image thumbnail

Euclidean distance

version 1.0 (1.15 KB) by

Calculate euclidean distance

1 Download

Updated

View License

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

Comments and Ratings (3)

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.

MATLAB Release
MATLAB 7.13 (R2011b)

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

» Watch video