Encountered this problem, because the Kmeans function in MATLAB by default, the iterative steps are 100 times, and you may be because of the need for clustering data is relatively large, resulting in your iteration 100 steps have not yet converged. You can view parameter information through the following command:
Help Kmeans
Here is some of its functional explanations:
' Options '-options for the iterative algorithm used to minimize the
Fitting criterion, as created by Statset. Choices of Statset
Parameters are:
' Display '-level of Display output. Choices are ' off ', (the
Default), ' ITER ', and ' final '.
' Maxiter '-Maximum number of iterations allowed. Default is 100.
Solution:
Add parameter settings in the Kmeans function where ' display ' shows the number of steps for the iteration, ' maxiter ' sets the number of steps for the iteration:
opts = Statset (' Display ', ' final ', ' Maxiter ', 1000);
[idx, CTRs] = Kmeans (Xl ', K, ' Options ', opts);