Efficient K-Means Clustering using JIT

A simple but fast tool for K-means clustering

You are now following this Submission

This is a tool for K-means clustering. After trying several different ways to program, I got the conclusion that using simple loops to perform distance calculation and comparison is most efficient and accurate because of the JIT acceleration in MATLAB.

The code is very simple and well documented, hence is suitable for beginners to learn k-means clustering algorithm.

Numerical comparisons show that this tool could be several times faster than kmeans in Statistics Toolbox.

Cite As

Yi Cao (2026). Efficient K-Means Clustering using JIT (https://www.mathworks.com/matlabcentral/fileexchange/19344-efficient-k-means-clustering-using-jit), MATLAB Central File Exchange. Retrieved .

Acknowledgements

Inspired: Patch color selector

Categories

Find more on Statistics and Machine Learning Toolbox in Help Center and MATLAB Answers

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0

correct bugs in examples