Main Content

PS Uniform Random Number

Generate uniformly distributed random numbers for physical modeling

  • Library:
  • Simscape / Foundation Library / Physical Signals / Sources

  • PS Uniform Random Number block

Description

ThePS Random Numberblock generates uniformly distributed random numbers over the interval you specify. To generate normally (Gaussian) distributed random numbers, use thePS Random Numberblock.

The block behavior is the same as the Simulink®Uniform Random Numberblock (except that it generates a physical signal rather than a Simulink signal).

You have an option to specify an initial time offset as part of theSample timeparameter. In this case, the block outputs 0 until the simulation time reaches theoffsetvalue, at which point the random sequence starts.

PS Uniform Random Numberblocks that use the same seed and parameters generate a repeatable sequence. The seed resets to the specified value each time a simulation starts.

Ports

Output

expand all

Output physical signal.

Parameters

expand all

The minimum output value generated by the block.

The maximum output value generated by the block.

The starting seed for the random number generator. Output is repeatable for a given seed. The seed must be an integer in the range of 0 to (2^32 – 1).

The value of the timestepinterval. The defaultstepvalue is1s. To specify an initial time offset, enter the parameter value as[step,offset],否则offsetvalue is assumed to be0. The offset must be less than the step size.

Compatibility Considerations

expand all

Behavior changed in R2019a

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Introduced in R2013a