I'm working on k-means in MATLAB. Here are my codes:
load cobat.txtk=input('Enter the number of cluster: ');if k<8 [cidx ctrs]=kmeans(cobat, k, 'dist', 'sqEuclidean'); Z = [cobat cidx]else h=msgbox('Must be less than eight');end
"cobat" is the file of mine and here it looks:
65 80 5545 75 7836 67 6665 78 8879 80 7277 85 6576 77 7965 67 8885 76 8856 76 65
My problem is everytime I run the code, it always shows different result, different cluster. How can I keep the clustering result always the same?
Best Answer