FreeMat: SEED Seed the Random Number Generator

FreeMat

- Main Page
- Related Pages

SEED Seed the Random Number Generator

Section: Random Number Generation

# Usage

Seeds the random number generator using the given integer seeds. Changing the seed allows you to choose which pseudo-random sequence is generated. The seed takes two `uint32` values:

      seed(s,t)

where `s` and `t` are the seed values. Note that due to limitations in `ranlib`, the values of `s,t` must be between `0 <= s,t <= 2^30`.

# Example

Here's an example of how the seed value can be used to reproduce a specific random number sequence.

    --> seed(32,41);
    --> rand(1,5)

    ans =
        0.8589    0.3727    0.5551    0.9557    0.7367

    --> seed(32,41);
    --> rand(1,5)

    ans =
        0.8589    0.3727    0.5551    0.9557    0.7367