Control random number generation

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.

 Respuesta aceptada

Rik
Rik el 28 de Mayo de 2021

0 votos

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.

Más respuestas (0)

Categorías

Más información sobre Random Number Generation en Centro de ayuda y File Exchange.

Productos

Versión

R2018a

Preguntada:

Yro
el 28 de Mayo de 2021

Respondida:

Rik
el 28 de Mayo de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by