This code demonstrates basic K-means Algorithm.
First, initial code book is defined in the beginning of the code.
Random data will be generated around this initial code book.
Finally, k-means algorithm will divides and classify through the iteration.
This example file consists of three m files as below.
The k-means algorithm will classify the scattered points with color.
run the code "RUN_THIS_kmeans.m"
Download MATLAB code here :