Random number or matrix (0-1).
random()
nCols | Number of columns (optional). If not given, a number will be returned. |
nRows | The number of rows (optional). If not given, it is assumed to be equal to nCols. |
return value | A random number or a random matrix with given size. |
The numbers generated have floating point values between 0 and 1.
The number of arguments can vary:
- If no arguments are given, a single number is returned.
- If one argument is given, a square matrix of random numbers is returned. The dimension
is determined by the argument.
- If two arguments are given, a random matrix with the given size is returned.
random(2,3)