From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Generating random 32-bit value
Date: Thu, 12 Feb 2009 19:25:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 12
Message-ID: <gn1t2g$a4s$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1234466704 10396 (12 Feb 2009 19:25:04 GMT)
NNTP-Posting-Date: Thu, 12 Feb 2009 19:25:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1432296
Xref: comp.soft-sys.matlab:517934


Very simple problem: I would like to create a random 32-bit value represented
in HEX. I played a little bit around with the rand function and like this I can easily
generate a random value:

dec2hex(floor(2^32 * rand));

However, I would be interested how "random" this numbers are? Is there some bias?
Can I somehow set a seed when using rand?

Many thanks