Skip to contents

Imitates the behavior of rand() on Matlab

Usage

rand(r = 1, c = 1)

Arguments

r

number of rows of output matrix

c

number of columns of output matrix

Value

\(r \times c\) matrix with random trials from a standard uniform distribution.

Examples

rand()
#>          [,1]
#> [1,] 0.293524
rand(3, 2)
#>           [,1]      [,2]
#> [1,] 0.9895830 0.5029909
#> [2,] 0.4362750 0.4473338
#> [3,] 0.4334439 0.7235085