MATLAB: Rand(‘twister’,5489) vs rand(‘twister’, sum(100*clock)) can some one explain

MATLAB and Simulink Student Suiterandom number generator

rand('twister',5489)
rand('twister', sum(100*clock))

Best Answer

rand('twister', 5489) gives an exactly repeatable sequence. If you later rand('twister', 5489) a second time, then the sequence of values will be exactly the same as the first time.
rand('twister', sum(100*clock))
reads the current clock time and manipulates it to calculate a number and uses that as the seed. If you run the same code again later, it probably will not give you exactly the same result. You might do this if you deliberately do not want to repeat the same sequence, such as if you were writing a game.
Note: these days the recommended call would be
rng('shuffle', 'twister')
to create a sequence using the twister random number generator with seed deliberately chosen to be unllkely to be the same later.