title: Matlab: Kmeans gives different results each time
body: <p>I running kmeans in matlab on a 400x1000 matrix and for some reason whenever I run the algorithm I get different results. Below is a code example:</p>
  
  <pre><code>[idx, ~, ~, ~] = kmeans(factor_matrix, 10, 'dist','sqeuclidean','replicates',20);
  </code></pre>
  
  <p>For some reason, each time I run this code I get different results? any ideas?</p>
  
  <p>I am using it to identify multicollinearity issues.</p>
  
  <p>Thanks for the help!</p>