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.
Examples
Limitations
To use this block in a For Each Subsystem (Simulink) you must set
Source of initial seed
toAuto
and the model toNormal
orAccelerator
simulation mode. This ensures that each run will generate independent noise samples.
Ports
Output
Parameters
Block Characteristics
Data Types |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
More About
Tips
Set Source of initial
seed to Parameter
and make sure that all
blocks have different Initial seed values when
running simulations in parallel using the parsim
(Simulink) function, such as for Monte Carlo simulation runs.
Otherwise, the different workers may generate the same random numbers (leading to misleading results) for these model configurations:
If the model is in rapid accelerator mode.
If this block has Simulate using set to
Code generation
and Source of initial seed set toAuto
.
For more information, see Choosing a Simulation Mode (Simulink).