From help-request at octave dot org Fri Oct 15 03:27:49 2004 Subject: restoring state of rand() From: Michael Creel To: help at octave dot org Date: Fri, 15 Oct 2004 10:22:19 +0200 Hello, "help rand" tells me that You can query the state of the random number generator using the form v = rand ("state") This returns a column vector V of length 625. Later, you can restore the random number generator to the state V using the form rand ("state", v) but my mileage varies: octave:1> help rand octave:2> v = rand("state"); octave:3> rand(3,1) ans = 0.82058 0.29780 0.98109 octave:4> rand("state",v); octave:5> rand(3,1) ans = 4.4409e-17 4.4409e-17 4.4409e-17 Can anyone help me out? I'm using octave-forge compiled against octave 2.1.57 Michael ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------