MATLAB: Error in kmeans of Matlab R2013

kmeans matlab r2013Statistics and Machine Learning Toolbox

Hello
I have an unexpected error by running kmeans in the last version of matlab 2013. I tried to cluster a data matrix having 12410 rows and 15 columns (it is actually Principal Component). There are no missing entries in the dataset. When I type >> k=kmeans(PC,2);
I have the following error
Error using randsample (line 106) REPLACE must be either true or false.
Error in kmeans/loopBody (line 357) C = X(randsample(S,n,k),:);
Error in internal.stats.parallel.smartForReduce (line 128) reduce = loopbody(iter, S);
Error in kmeans (line 295) ClusterBest = internal.stats.parallel.smartForReduce(…
I precise that I had not this error on previous version with exactly the same coding
Thanks in advance for any help and suggestion
Vincent

Best Answer

Type
which kmeans
which randsample
to verify that you are using the functions from the official MATLAB installation. If you are, try to reproduce the problem on a smaller set of data and post that set here.