help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Generate same rand sequence in Octave, Matlab


From: Jason C. Wells
Subject: Re: Generate same rand sequence in Octave, Matlab
Date: Thu, 08 Dec 2011 16:44:47 -0800
User-agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.22) Gecko/20110926 Lightning/1.0b2 Thunderbird/3.1.14

On 12/08/11 11:39, Steve Thompson 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?

You could write the sequence to a file with one program and read it with the other. (I realize that I haven't answered your question, maybe I've helped though.)

Regards,
Jason


reply via email to

[Prev in Thread] Current Thread [Next in Thread]