Generates random data from the uniform probability distribution. |
||
Syntax |
M = rand() M = rand(m) M = rand([m, n]) M = rand(m, n) |
|
Arguments |
Name |
Description |
m |
Number of output rows. |
|
n |
Number of output columns. |
|
Outputs |
Name |
Description |
M |
A matrix of double; random numbers from the continuous uniform distribution. |
|
Example |
Syntax |
|
print(rand()) print(rand([3 2])) print(rand(3, 2)) |
||
Comments |
The 'rand' function is a random matrix generator. rand() without arguments gives a matrix of size 1x1. The size inputs m and n should be positive integers. |
|
See Also: |