function [dist,clusters] = recluster(data,dist,clusters,i) %RECLUSTER [dist,clusters] = recluster(data,dist,clusters,i) % Reassigns each point to the nearest hub n = size(data,1); temp = i*ones(n,1); newdist=distance(data,temp); for r=1:n if newdist(r) < dist(r) dist(r)=newdist(r); clusters(r)=i; end %end for if end %end for for end