We implemented an interactive KMeans algorithm in Matlab which visually represents the processing and functioning of the algorithm.
Algorith based on 1-Dimensional data A random array will be created with length of your choice and then clustered into 2 clusters using the K-means clustering algorithm
Algorith based on 2-Dimensional data Just run the file to see the interactive graph that shows the movements of displacement of the centroids (or means). You just need to specify the number of clusters, iterations and data points that are generated randomly with a normal distribution.