rand: Matrix/Array of Uniform Random Numbers

Description Usage Arguments Value See Also Examples

Description

Construct a matrix or multi-way array of uniform random deviates.

Usage

1
rand(nrow = 1, ncol = 1, ..., min = 0, max = 1, atleast_2d = NULL)

Arguments

nrow

The desired number of rows.

ncol

The desired number of columns.

...

Further dimensions of the array.

min

Lower limit for the uniform distribution. Must be finite. (rand only).

max

Upper limit for the uniform distribution. Must be finite. (rand only).

atleast_2d

Logical indicating whether or not to force column vectors to have a second dimension equal to one. Defaults to FALSE. This behavior can also be changed globally using, for example options(atleast_2d = TRUE).

Value

A matrix or array of pseudorandom numbers.

See Also

randi, randn, runif.

Examples

1
2
rand(100, 100)  # 100 by 100 matrix of uniform random numbers
rand(2, 3, min = 100, max = 200)  

bgreenwell/ramify documentation built on May 12, 2019, 8:20 p.m.