Random Integer Generator
Generate integers randomly distributed in specified range
Libraries:
Communications Toolbox /
Comm Sources /
Random Data Sources
Description
The Random Integer Generator block generates uniformly distributed random integers in the range [0, M-1], where M is specified by the Set size parameter. Use this block to generate random binary-valued or integer-valued data.
To ensure that the model uses different initial seeds, set the Simulate using parameter to
Interpreted execution
, and run the simulation in Normal
or Accelerator mode. For more information, see Limitations.
Examples
Limitations
In Rapid Accelerator simulation mode, when you set Simulate using to
Interpreted execution
and Source of initial seed toAuto
, the block generates the same numbers every time the simulation runs. This behavior is equivalent to setting Source of initial seed toParameter
and setting Initial seed to0
.In all simulation modes (Normal, Accelerator, and Rapid Accelerator), when you set Simulate using to
Code generation
and Source of initial seed toAuto
, the block generates the same numbers every time the simulation runs. This behavior is equivalent to setting Source of initial seed toParameter
and Initial seed to0
.
For more information, see Choosing a Simulation Mode (Simulink).
Ports
Output
Parameters
Block Characteristics
Data Types |
|
Multidimensional Signals |
|
Variable-Size Signals |
|