MATLAB: Node’s number in k-mean

k-meannode number in k-meanStatistics and Machine Learning Toolbox

I have a number of nodes that is expressed by 'X' and has the value of '98', number of cluster is '14', the code is working fine, but in this code, the number of nodes is not equal in all the clusters, and I need the number of node in each cluster to be '7'. Any help?
X = [A, B];
[idx,C,sumd] = kmeans(X,7,'Distance','cityblock','replicates',3);

Best Answer

If you need the number of nodes in each cluster to be the same, then you should not use kmeans.