1.0

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

Euclidean distance

by

 

Calculate euclidean distance

| Watch this File

File Information
Description

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:

http://www.mathworks.co.uk/matlabcentral/fileexchange/18937-ipdm-inter-point-distance-matrix

04 Jun 2013 Florent Hennart  
04 Jun 2013 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