MATLAB で乱数発生のシードを​定義するにはどのよう​に記述しますか?

조회 수: 14 (최근 30일)
MathWorks Support Team
MathWorks Support Team 2013년 10월 25일
편집: MathWorks Support Team 2025년 10월 10일
MATLAB 7.7 (R2008b) での乱数発生のシードの定義
rand('seed',34)
を、MATLAB 7.8(R2009a) で設定する方法を教えてください。

채택된 답변

MathWorks Support Team
MathWorks Support Team 2025년 10월 10일
편집: MathWorks Support Team 2025년 10월 10일
"rand('seed',34);" のような記述方法は MATLAB 7.7(R2008b) までの記述方法で、MATLAB 7.8(R2009a)以降は下記のように記述します。
RandStream.setDefaultStream (RandStream('mcg16807','seed',34))
- 乱数発生器アルゴリズム (MATLAB ユーザーガイド)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 乱数発生器에 대해 자세히 알아보기

제품


릴리스

R2010a

Community Treasure Hunt

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

Start Hunting!