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

19 views (last 30 days)
MathWorks Support Team
MathWorks Support Team on 25 Oct 2013
MATLAB 7.7 (R2008b) での乱数発生のシードの定義
rand('seed',34)
を、MATLAB 7.8(R2009a) で設定する方法を教えてください。

Accepted Answer

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

More Answers (0)

Categories

Find more on 乱数発生器 in Help Center and File Exchange

Products


Release

R2010a

Community Treasure Hunt

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

Start Hunting!