Random number generator errors after switching modes from 'state' to 'shuffle'
Show older comments
When I specify a seed value for the random number generator using:
randn('state', sd);
and then try to use the current time as the seed value using:
rng('shuffle');
MATLAB errors saying I need to reinitialize my random number generator: ERROR: Error using rng (line 99) The current random number generator is the legacy generator. This is because you have executed a command such as rand('state',0), which activates MATLAB's legacy random number behavior. You may not use RNG to reseed the legacy random number generator. Use rng('default') to reinitialize the random number generator to its startup configuration, or call RNG using a specific generator type, such as rng(seed,'twister').
Accepted Answer
More Answers (0)
Categories
Find more on Random Number Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!