output: matrix of all pairwise distances input: data points (centers) (C) Charles Elkan
0001 function centdist = alldist(centers) 0002 % output: matrix of all pairwise distances 0003 % input: data points (centers) 0004 % (C) Charles Elkan 0005 0006 k = size(centers,1); 0007 centdist = zeros(k,k); 0008 for j = 1:k 0009 centdist(1:j-1,j) = calcdist(centers(1:j-1,:),centers(j,:)); 0010 end 0011 centdist = centdist+centdist';