RAND

Purpose:

Generates a uniformly distributed random array with values between 0.0 and 1.0.

Syntax:

RAND(numrows, numcols)

numrows

-

An integer. The number of output rows.

numcols

-

Optional. An integer, the number of output columns. Defaults to numrows.

Returns:

A scalar, series or array.

 

RAND with no input arguments returns a scalar.

Example:

rand(20, 5)

 

Generates a 20 row by 5 column array of uniformly distributed random numbers with values between 0.0 and 1.0.

Example:

rand(20)

 

Generates a 20 x 20 random array.

Example:

rand

 

Returns a single random real value between 0.0 and 1.0.

Remarks:

RAND uses GRAND to generate the random values. The SEEDRAND function determines the initial seed of the random number generator.

See Also:

GNORMAL

GRANDOM

RANDN

SEEDRAND