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

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

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

Post by matlab1 »

The ''Seed'' property is read-only, and can only be set when you create a stream, or with the RESET method
matlab1
Site Admin
Posts: 4797
Joined: Thu Dec 15, 2016 9:30 am
Contact:

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

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

Who is online

Users browsing this forum: No registered users and 14 guests