Watch this Author's files
Thanks. This saved me time!
I find a simple
faster to compute the Euclidean distance
Thanks. using repmat has made it useful and fast.
Things can go wrong in extreme cases.
If dimensionality is very high numerical errors will kick in.
I have twenty-five hundred 10'000 dimensional vectors stored in matrix X and
sum(diag(distance(X',X'))) = 6e-4;
Other than that, great job!