I am trying to generate a list of 36 random numbers. I am
using:
RandomNumber=randperm(36);
However, my problem is that I generate the exact same
sequence every time that I run the command for the first
time (directly after opening Matlab). Is there a way to
specify a random seed so that I get a different sequence
each time I run the command?
Yumnam Kirani Singh <kirani.singh@gmail.com> wrote in
message
<5169857.1217317827085.JavaMail.jakarta@nitrogen.mathforum.o
rg>...
> See help on rand to set the state of random number
generation.
After reading the help, I still don't really understand how
to generate a new random number list each time. Can you
provide an example? Thanks!
dpb <none@non.net> wrote in message <g6o2vt$ur8$1@aioe.org>...
> Jessica wrote:
> ...
>
> > After reading the help, I still don't really understand how
> > to generate a new random number list each time. Can you
> > provide an example? Thanks!
>
> One technique would be something like the example in the
help --
>
> "RAND('state',sum(100*clock)) resets it to a different
state each time."
>
> --
>
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Disclaimer prior to use.