Possible solution (I do not quite understand what you mean by repetition):
X are your points with coordinates x = X(:,1), y = X(:,2) dist = sqrt(bsxfun(@minus,X(:,1),X(:,1)').^2 + bsxfun(@minus,X(:,2),X(:,2)').^2)
So
dist(i,j) is the euclidean distance between i and j
Of course, the matrix is โโsymmetric. You can easily reduce complexity.
Acorbe
source share