Cannot set the normal transformation algorithm for the legacy generator

Post Reply
matlab1
Site Admin
Posts: 4797
Joined: Thu Dec 15, 2016 9:30 am
Contact:

Cannot set the normal transformation algorithm for the legacy generator

Post by matlab1 »

Cannot set the normal transformation algorithm for the legacy generator
matlab1
Site Admin
Posts: 4797
Joined: Thu Dec 15, 2016 9:30 am
Contact:

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

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests