kmeans k-means clustering algorithm implementation using Matlab. X is the dataset and K is the nuber of clusters.