Command Reference : Function Reference : Function Reference: M
  
 
@mrnd
Matrix of uniform random numbers.
Syntax: @mrnd(n1[, n2])
n1: integer
n2: (optional) integer
Return: matrix
Creates a matrix filled with uniform (0, 1) random numbers. The size of the matrix is given by the integers n1 (number of rows) and n2 (number of columns).
Examples
matrix m1 = @mrnd(3,2)
creates a matrix filled with uniform random numbers.
If n2 is omitted or set to 1, the function returns a vector as in
vector v1 = @mrnd(18)
You may obtain a random sym of uniform numbers by creating a square source matrix of uniform numbers and assigning it to a sym matrix,
sym s1 = @mrnd(5, 5)
which creates the sym S1 based on the lower triangle of the source matrix.
Cross-references
See also @mnrnd, nrnd, and rnd.