Home > Archive > Matlab > January 2008 > weird thing using 'rand'
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
weird thing using 'rand'
|
|
|
|
i use 'rand' to get a random network topology in my project,
but whenever i restart matlab and run it for sevral times,
it gives me the same topology in same order,
even more,
it doesn't matter whether i do it in lab or at home!
| |
| Walter Roberson 2008-01-31, 8:28 pm |
| In article <fntor2$p7g$1@fred.mathworks.com>,
HUI <michaelyang0720@mathworks.com> wrote:
>i use 'rand' to get a random network topology in my project,
>but whenever i restart matlab and run it for sevral times,
>it gives me the same topology in same order,
>even more,
>it doesn't matter whether i do it in lab or at home!
help rand
The sequence of numbers produced by RAND is determined by the internal
state of the generator. Setting the generator to the same fixed state
allows computations to be repeated. Setting the generator to different
states leads to unique computations, however, it does not improve any
statistical properties. Since MATLAB resets the state at start-up, RAND
will generate the same sequence of numbers in each session unless the
state is changed.
--
So you found your solution
What will be your last contribution?
-- Supertramp (Fool's Overture)
|
|
|
|
|