Controlling random number generation using rand
or
randn
is no longer recommended. Use these functions
only to generate random numbers and the new rng
function to control the
generation process.
Update your code using the following table that shows replacements for
discouraged syntaxes with an integer seed sd
or a
time-dependent seed.
Before | After | |
---|---|---|
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
For more information including how to reproduce discouraged behavior with the
rng
function, see Replace Discouraged Syntaxes of rand and randn.