Path: news.mathworks.com!not-for-mail
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$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1234466704 10396 172.30.248.35 (12 Feb 2009 19:25:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 12 Feb 2009 19:25:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1432296
Xref: news.mathworks.com comp.soft-sys.matlab:517934

Hi

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