K-Means Algorithms for Data Clustering
K-Means in Statistics Toolbox (Matlab code)
The goodness of this code is that it provides the options, such as 'distance measure', 'emptyaction', and 'onlinephase'. It is quit slow when dealing with large datasets and sometimes memory will be overflow.
Efficient K-Means using JIT (Matlab code)
This code uses the JIT acceleration in Matlab, so it is much faster than k-means in the Statistics Toolbox. It is very simple and easy to read.
Acknowledgements: The code was provided by Yi Cao.
You can also find it at http://www.mathworks.com/matlabcentral/fileexchange/19344-efficient-k-means-clustering-using-jit
K-means from VGG ( C code with Matlab interface)
This code calls the c code of k-means. It is the fastest one among these three and can deal with large dimensional matrix.
Acknowledgements: The code was provided by Mark Everingham. http://www.comp.leeds.ac.uk/me