[idx,mu] = kmeans(X,K); % initial means of the components