[SciPy-user] How to generate equivalent "random" numbers in matlab and scipy?

Nicolas Pinto pinto@mit....
Sun Feb 22 21:59:38 CST 2009

Dear all,

I'd like to generate equivalent sequences of 'random' numbers in matlab and
scipy, is there any way I can do that? I tried to fix the seed (see below)
but it doesn't work.

# scipy
In [29]: random.seed(1); random.permutation(5)+1
Out[29]: array([3, 2, 5, 1, 4])

% matlab
>> rand('seed', 1); randperm(5)

ans =

     4     3     5     2     1

Thanks for your time.

Best regards,

Nicolas Pinto
Ph.D. Candidate, Brain & Computer Sciences
Massachusetts Institute of Technology, USA
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20090222/8361672b/attachment.html 

More information about the SciPy-user mailing list