채택된 답변

Jan
Jan 2017년 6월 20일
편집: Jan 2017년 6월 20일

0 개 추천

No, this is not possible in Matlab. As far as I know, you can seed it with 32 bits only - but I'm still such surprised about this, that I hope I've overseen a detail.

댓글 수: 1

Noam Mazor
Noam Mazor 2017년 6월 22일
Thanks! Is there a simple way to use the C implementation as an external lib and to initialize it from there?

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Peter Perkins
Peter Perkins 2017년 6월 28일

0 개 추천

The "array" you are talking about is typically a state vector, right? You can set the generator state:
>> r = RandStream.getGlobalStream
r =
mt19937ar random stream (current global stream)
Seed: 0
NormalTransform: Ziggurat
>> s = r.State;
>> rand(1,5)
ans =
0.09754 0.2785 0.54688 0.95751 0.96489
>> r.State = s;
>> rand(1,5)
ans =
0.09754 0.2785 0.54688 0.95751 0.96489

댓글 수: 1

Noam Mazor
Noam Mazor 2017년 6월 28일
Hi, No, the C implementation has a function (init_by_array) that maps arbitrary array (in any length) into a state vector.
Thanks!

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Random Number Generation에 대해 자세히 알아보기

질문:

2017년 6월 20일

댓글:

2017년 6월 28일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by