srand() <http://docs.julialang.org/en/latest/stdlib/base/#Base.srand>

Ivar

kl. 13:08:51 UTC+2 torsdag 17. april 2014 skrev X Du følgende:
>
>
>
> Hi All,
>
>   Is there a comment to save and restore the current state to reproduce 
> exactly the same random numbers? e.g. the code in Matlab:
>
> stream = RandStream.getGlobalStream;
> savedState = stream.State;
> u1 = rand(1,5)
> u1 =
>     0.8147    0.9058    0.1270    0.9134    0.6324
>
> stream.State = savedState;
> u2 = rand(1,5)
> u2 =
>     0.8147    0.9058    0.1270    0.9134    0.6324
>
> Thanks!
>
> Isaac
>
>

Reply via email to