function ptoc = kmeans_update_clusters ( dim, n, p, k, c )

%% KMEANS_UPDATE_CLUSTERS assigns data to clusters based on the centers.
%
  for i = 1 : n
    for j = 1 : k
      dist(j) = norm ( p(1:dim,i) - c(1:dim,j) );
    end
    [ dummy, ptoc(i) ] = min ( dist(1:k) );
  end

  return
end
