Control random number generation

1 回表示 (過去 30 日間)
Yro
Yro 2021 年 5 月 28 日
回答済み: Rik 2021 年 5 月 28 日
I have a question about the rng(seed) (random number generator) function. I have a code with which I call several functions in which random numbers are generated. In these functions is also used the seed that I defined in the main file?
Thanks in advance.

採用された回答

Rik
Rik 2021 年 5 月 28 日
Slightly depending on what you mean: yes.
The random number generation has a global state, so it doesn't matter if the call is nested in a function or not.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeRandom Number Generation についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by