Learn R Programming

matlab2r (version 1.5.0)

rand: Generate matrix with U(0, 1) trials

Description

Imitates the behavior of rand() on Matlab

Usage

rand(r = 1, c = 1)

Value

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

Arguments

r

number of rows of output matrix

c

number of columns of output matrix

Examples

Run this code
rand()
rand(3, 2)

Run the code above in your browser using DataLab