Date: Jan 25, 2013 5:27 PM
Author: Steven Lord
Subject: Re: random generator seed



"Elnaz " <ebsadeghian@gmail.com> wrote in message
news:kdur27$4sr$1@newscl01ah.mathworks.com...
> Hi all,
> I am running several MATLAB in parallel and I want to have my script
> running on several machines generate the same random numbers. To do this,
> I am doing rng('default'); Is this the same as doing:
> rand('state',0); % set state to 0


No, and you probably shouldn't be doing the latter if you can avoid it.

> In other worsd, is the default setting '0'?

No. See the page linked in the Note at the top of the Description section
for a more thorough explanation of what rng('default') is doing and why we
discourage the rand(string, seedValue) and randn(string, seedValue)
syntaxes.

http://www.mathworks.com/help/matlab/ref/rng.html

That page also lists the RNG equivalent for "rand('state', 0)" if you need
to reproduce results from older releases of MATLAB.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com