You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
This code implements the basic kmeans algorithm using Euclidean distance, and its computation speed is optimized using C/C++ and multiple threads.
When the number of samples and feature dimensions are large, this code would be significantly faster than the one in the Matlab toolbox and other efficient implementations such as litekmeans(http://www.cad.zju.edu.cn/home/dengcai/Data/code/litekmeans.m)
For example, for data with 17 dimensions and 154401 samples, the following is the speeds of different codes to generate the same result after 100 iterations in a PC with 3.4GHz i7 Intel CPU:
Matlab toolbox: 10.32 sec
litekmeans: 7.50 sec
This code: 2.92 sec
Cite As
Haw-Shiuan Chang (2026). kmeans_mt (https://www.mathworks.com/matlabcentral/fileexchange/47737-kmeans_mt), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.3.0.0 (7.11 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
