state = tallrng
returns the current state of the random number generator as a structure. Use the
structure to restore the random number generator to the captured state at a later
time with tallrng(state).

Input Arguments

seed — Random number seednonnegative integer

Random number seed, specified as a nonnegative integer. The seed specifies
the starting point for the algorithm to generate random numbers. Specify the
seed when you want reproducible results.

The maximum value of the seed is
232-1.

Example: tallrng(3)

generator — Random number generatorcharacter vector | string

Random number generator, specified as a character vector or string for any
valid random number generator that supports streams and substreams. See
Choosing a Random Number Generator for a list of available
generators.

Example: tallrng(0,'mlfg6331_64')

state — Previous random number generator statestructure

Previous random number generator state, specified as a structure
previously created using state = tallrng.

Example: state = tallrng captures the current state of
the random number generator, and tallrng(state) restores
the generator to those settings.