Why do I get this message : Error using kmeans ---X must have more rows than the number of clusters.
Show older comments
Hello,
When I run a collegue script, i get this error message: Error using kmeans ---X must have more rows than the number of clusters. What are my option to solve this problem?
Thank you.
Andree
Accepted Answer
More Answers (3)
Andree-Sylvie Carbonneau
on 15 Jan 2014
2 Comments
José-Luis
on 15 Jan 2014
size(ab)?
Andree-Sylvie Carbonneau
on 16 Jan 2014
Edited: Andree-Sylvie Carbonneau
on 16 Jan 2014
Thulfiqar Hussein
on 22 Mar 2017
0 votes
the value (X/K) should be integer number without fractions. for example if you have 10 objects and cluster them to 3 groups you will get 10/3 = 3.3 and this error will pop up, but if you cluster them to 2 or 5 groups there will be no problem.
Laura Hensel
on 29 Feb 2020
0 votes
You should also check if you have any missing values in your matrix
Categories
Find more on Cluster Analysis and Anomaly Detection in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!