% [C,L,e] = k_means(X,K) K-means clustering
%
% In:
%   X: NxD matrix containing N D-dimensional data points rowwise.
%   K: desired number of clusters.
% Out:
%   C: KxD matrix containing the K cluster means.
%   L: Nx1 list containing the cluster labels (1 to K). Thus,
%      L(n) = k says point Xn is in cluster k.
%   e: list of values (for each iteration) of the error function.
%      This is the sum over all clusters of the within-cluster sums of
%      point-to-mean distances.

function [C,L,e] = k_means(X,K)

