MATLAB: How can the center be determined by the Kmeans method

centerized of kmeans algorithmMATLAB

Best Answer

[idx,C,D] = kmeans(grayImge(:),numberOfclasses) ;
C is your cneter.
Read about kmeans. You can your center along with the function. The output is random..the classe indices change for every run.