[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Generate same rand sequence in Octave, Matlab
From: |
Jordi Gutiérrez Hermoso |
Subject: |
Re: Generate same rand sequence in Octave, Matlab |
Date: |
Thu, 8 Dec 2011 18:17:50 -0500 |
On 8 December 2011 14:39, Steve Thompson <address@hidden> wrote:
> Hi list,
>
> I'm trying to figure out if it is possible to get the same rand (and randn)
> sequence in Matlab (2007) and Octave.
>
> In Matlab (7.4.0.287 (R2007a)) I get:
>>> rand('state', 0)
>>> rand
> ans = 0.9501
>
> In Octave (3.2.4) I get:
> octave:1> rand('state', 0)
> octave:2> rand
> ans = 0.84442
>
> It is possible to get the same sequence?
Unlkely. We don't use the same implementation, and I would expect the
details of their implementation are hidden, so there's no way we could
even match it.
If you are able to find a description of the details (if possible,
reading the source) and are able to describe those details to us
WITHOUT showing us the source (i.e. clean room reverse engineering,
just give us a spec to implement) we might be able to patch Octave to
do this.
- Jordi G. H.