How does the Random generator work?
The algorithm for the rand function can be found in S. K. Park and K. W. Miller, “Random Number Generators: Good ones are hard to find,” Comm. ACM, vol. 32, n. 10, Oct. 1988, pg 1192-1201. The formula used for the seed is: seed=(7^5*seed)mod(2^31-1) If you want to set the initial seed to an random value, type the following at the MATLAB prompt: rand(‘SEED’,fix(100*sum(clock))) This will use the clock to set the seed.