Home > demo3 > alldist.m

alldist

PURPOSE ^

output: matrix of all pairwise distances

SYNOPSIS ^

function centdist = alldist(centers)

DESCRIPTION ^

 output: matrix of all pairwise distances
 input: data points (centers)
 (C) Charles Elkan

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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';

Generated on Sat 22-Aug-2009 22:15:36 by m2html © 2003