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], whereMis specified by theSet sizeparameter. Use this block to generate random binary-valued or integer-valued data.
To ensure that the model uses different initial seeds, set theSimulate usingparameter toInterpreted execution
, and run the simulation in Normal or Accelerator mode. For more information, seeLimitations。
Examples
Limitations
In Rapid Accelerator simulation mode, when you setSimulate usingto
Interpreted execution
andSource of initial seedtoAuto
, the block generates the same numbers every time the simulation runs. This behavior is equivalent to settingSource of initial seedtoParameter
and setting最初的种子to0
。In all simulation modes (Normal, Accelerator, and Rapid Accelerator), when you setSimulate usingto
Code generation
andSource of initial seedtoAuto
, the block generates the same numbers every time the simulation runs. This behavior is equivalent to settingSource of initial seedtoParameter
and最初的种子to0
。
For more information, seeChoosing a Simulation Mode(Simulink)。
Ports
Output
Parameters
Block Characteristics
Data Types |
|
Multidimensional Signals |
|
Variable-Size Signals |
|