MATLAB: Is different rng(1) rng(2) rng(3) in K means clustering

k means clusteringkmeansrngseedStatistics and Machine Learning Toolbox

i want to know 'why is different rng(1), rng(2), rng(3) in K means clustering?'
Please tell me why,,,
and What is seed? I don't know what you mean after reading the example.

Best Answer

K means clustering algorithm generates the mean vectors corresponding to the number of the cluster you provide.
The point is that these mean vectors are generated randomly, however the randomness cannot be natural but it is synthesized by computational methods, i.e., the randomness is controllable.
The function rng allows you to controll the randomness by specifying a seed.