Random Numbers

Purpose

Generate uniformly distributed random numbers

Library

Control / Sources

Description

../../_images/randomnumbers.svg

The Random Numbers block generates uniformly distributed random numbers. The boundaries of the generated values can be configured in the component dialog. Fig. 146 illustrates the distribution for two different sets of parameters.

../../_images/uniform.svg

Fig. 146 Uniform distribution for different parameter sets

The seed of the generator initializes the algorithm at the simulation start. For the same seed, the sequence of random numbers is reproduced in every simulation run. If this behavior is undesired, the system time can be used as a seed. To minimize correlation effects, it is recommended to use different seeds if multiple random generators are used in one model.

Parameters

Minimum

The lower boundary of the random numbers.

Maximum

The upper boundary of the random numbers.

Seed

The seed used to initialize the Random Numbers generator.

Sample time

A scalar specifying the sampling period or a two-element vector specifying the sampling period and offset, in seconds \((\mathrm{s})\), used for generating random output values. See also Sample Times.

References