Page 1 of 1

The ''Seed'' property is read-only, and can only be set when you create a stream, or with the RESET method

Posted: Sat Jun 17, 2017 6:42 am
by matlab1
The ''Seed'' property is read-only, and can only be set when you create a stream, or with the RESET method

Re: The ''Seed'' property is read-only, and can only be set when you create a stream, or with the RESET method

Posted: Sun Jan 10, 2021 1:05 pm
by matlab1
Seed property is used in random number generation.

rng(seed)


https://www.mathworks.com/help/matlab/ref/rng.html

https://www.mathworks.com/help/matlab/ref/randstream.html



seed — Generator initialization

0 (default) | positive integer | 'default' | 'shuffle' | structure

Generator initialization, specified as one of the following options.

Value Description
0 Initializes generator with seed 0.

positive integer Initializes generator with the specified positive integer seed, such as 1.

'default' Initializes Mersenne Twister generator with seed 0. This is the default setting at the start of each MATLAB session.

'shuffle' Initializes generator based on the current time, resulting in a different sequence of random numbers after each call to rng.

structure Initializes generator based on the settings contained in a structure with fields Type, Seed, and State.