i have two questions to ask .
1) can you explain why did you choose two values from variable 'point1' and 'point2'instead of four.
2) why are you applying convolution two times?
3) finally, can i use other filter instead of gaussian?
early reply would be appreciable.
Following the analysis of Stuart Layton, I've found a merely faster way to perform the same computation:
d = sqrt(bsxfun(@minus,bsxfun(@plus,sum(a.^2,1),sum(b.^2,1)'),2*(a'*b).'));
Using the same tool as Stuart Layton (modified to have the tic/toc outside the loop), I measure 4.3607ms for distance.m and 4.1252ms for mine. Does not change dramatically, ok.
11 Nov 2013
A fully vectorized function that computes the Euclidean distance matrix between two sets of vectors.