Simulink Reference Previous page   Next Page
Random Number

Generate normally distributed random numbers

Library

Sources

Description


The Random Number block generates normally distributed random numbers. The seed is reset to the specified value each time a simulation starts.

By default, the sequence produced has a mean of 0 and a variance of 1, although you can vary these parameters. The sequence of numbers is repeatable and can be produced by any Random Number block with the same seed and parameters. To generate a vector of random numbers with the same mean and variance, specify the Initial seed parameter as a vector.

To generate uniformly distributed random numbers, use the Uniform Random Number block.

Avoid integrating a random signal, because solvers are meant to integrate relatively smooth signals. Instead, use the Band-Limited White Noise block.

All the block's numeric parameters must be of the same dimension after scalar expansion.

Data Type Support

The Random Number block accepts and outputs signals of type double.

Parameters and Dialog Box

Opening this dialog box causes a running simulation to pause. See Changing Source Block Parameters in the online Simulink documentation for details.

Mean
The mean of the random numbers. The default is 0.
Variance
The variance of the random numbers. The default is 1.
Initial seed
The starting seed for the random number generator. The seed must be 0 or a positive integer. The default is 0.
Sample time
The time interval between samples. The default is 0, causing the block to have continuous sample time. See Specifying Sample Time in the online documentation for more information.
Interpret vector parameters as 1-D
If you select this option and the other parameters are one-row or one-column matrices, after scalar expansion, the block outputs a 1-D signal (vector). Otherwise, the output dimensionality is the same as that of the other parameters.

Characteristics

Sample Time
Specified in the Sample time parameter
Scalar Expansion
Yes, of parameters
Dimensionalized
Yes
Zero Crossing
No


Previous page  Ramp Rate Limiter Next page

© 1994-2005 The MathWorks, Inc.