Page 1 of 1

Cannot set the normal transformation algorithm for the legacy generator

Posted: Sat Jun 17, 2017 6:48 am
by matlab1
Cannot set the normal transformation algorithm for the legacy generator

Re: Cannot set the normal transformation algorithm for the legacy generator

Posted: Sun Jan 10, 2021 12:42 pm
by matlab1
The most common way to use a settings structure is to restore the generator state. However, because the structure contains not only the state, but also the generator type and seed, it's also a convenient way to temporarily switch generator types. For example, if you need to create values using one of the legacy generators from MATLAB 5.0, you can save the current settings at the same time that you switch to use the old generator ...

Code: Select all

previousSettings = rng(0,'v5uniform')

and then restore the original settings later.

Code: Select all

rng(previousSettings)
You should not modify the contents of any of the fields in a settings structure. In particular, you should not construct your own state vector, or even depend on the format of the generator state.