help-octave
[Top][All Lists]
Advanced

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

Re: Same sequence of random number generators than under Matlab?


From: Sergei Steshenko
Subject: Re: Same sequence of random number generators than under Matlab?
Date: Sun, 3 Jun 2012 10:45:41 -0700 (PDT)




----- Original Message -----
> From: Mathieu Dubois <address@hidden>
> To: address@hidden
> Cc: 
> Sent: Sunday, June 3, 2012 5:03 PM
> Subject: Same sequence of random number generators than under Matlab?
> 
> Hello,
> 
> I want to comapre the output of the Self-Organinzin Map algorithm under 
> Matlab 
> and Octave.
> 
> The algorithm is stochastic because, as in most training algorithm, the data 
> are 
> presented inrandom order.
> In order to compare as precisely as possible the Matlab and Octave version it 
> seems necessary to have the same sequence of random numbers.
> 
> Is there a way to do that?
> 
> I have tried the following:
> rand('twister', 10);
> s = rand(10, 1);
> disp(s);
> disp(mean(s));
> disp(var(s));
> 
> The sequences are different (but the statistics are close).
> 
> Mathieu
> 
> 

As others have already suggested, generate the sequence in one tool (either 
Matlab or Octave), store it in a file, and use it in the other tool.

Regards,
  Sergei.



reply via email to

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