File Exchange

image thumbnail

Clustering via Jenks Natural Breaks

version 1.0.1 (3.51 KB) by MS
Example on using the Jenks Natural Breaks method to cluster a one-dimensional data array into two classes.


Updated 06 Sep 2019

GitHub view license on GitHub

Jenks Natural Breaks is a data clustering method. It is an optimization process that finds the best arrangement of values into different classes. It can be used for step-change detection in noisy data. In this example, a one-dimensional array of noisy values is used. The method is applied to the array to find the index of the interface separating the high and low values.

Cite As

MS (2020). Clustering via Jenks Natural Breaks (, GitHub. Retrieved .

Comments and Ratings (2)


Thanks for your comment, Roberto. Yes, you are right, it should be: class_2 = Array(i+1:total);


Thank you very much for this code, it is great. Just one note: I would expect line 14 in get_jenks_interface.m to read like this:
class_2 = Array(i+1:total);

rather than
class_2 = Array(i:total);

Am I right?



Connected to GitHub

MATLAB Release Compatibility
Created with R2018a
Compatible with any release
Platform Compatibility
Windows macOS Linux