File Exchange

image thumbnail

Dunn's index

version (1.76 KB) by Julian Ramos
This is an implementation of the Dunn's index for clustering.


Updated 23 Jul 2012

View Version History

View License

The Dunn's index measures compactness (Maximum distance in between data points of clusters) and clusters separation (minimum distance between clusters). This measurement serves as a measure to find the right number of clusters in a data set, where the maximum value of the index represents the right partitioning given the index (partition with the highest separation between clusters and less spread data in between clusters).

For more information about the Dunn's index check:

Validity index for crisp and fuzzy clusters, Malay K. Pakhira, Pattern Recognition Volume 37, Issue 3, March 2004, Pages 487-501

Cite As

Julian Ramos (2021). Dunn's index (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (9)


daoming she


No spectralClust function in the FIles???

pdp rpa

hello this code is working fine on 100*50 dimensional images but not above that. I want to work on high resolution images too. Please help me soon. Thanks in advance

Jalil Kianfar

Thanks for the very helpful function. The dunns.m function works fine but the spectralClust function in the demo file is not supported anymore in Matalb R2011b.

Julian Ramos

Hi all, It seems the server would not allow me to update the file so instead I have just upload it again, notice the new version only difference is that I'm including a demo that shows how to use the Index.


Hi can i know how have u represented the dissimilarity matrix, when i use mine i get error as index exceeds dimension

Mehdi Hassan

I have also tried to run this code but unable to run it.
If it is possible for you to write a simple example so that we can understand it well.
Thanks in advance.

Jakub Bialek

Hmmm returns empty value for my data...Wonder why...

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

Inspired: Modified & Generalized Dunn's index

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!