| Statistics Toolbox | Search  Help Desk |
| unifrnd | Examples |
Random numbers from the continuous uniform distribution.
Syntax
R = unifrnd(A,B) R = unifrnd(A,B,m) R = unifrnd(A,B,m,n)
Description
R = unifrnd(A,B) generates uniform random numbers with parameters A and B. The size of R is the common size of A and B if both are matrices. If either parameter is a scalar, the size of R is the size of the other parameter.
R = unifrnd(A,B,m) generates uniform random numbers with parameters A and B. m is a 1-by-2 vector that contains the row and column dimensions of R.
R = unifrnd(A,B,m,n) generates uniform random numbers with parameters A and B. The scalars m and n are the row and column dimensions of R.
Examples
random = unifrnd(0,1:6)
random =
0.2190 0.0941 2.0366 2.7172 4.6735 2.3010
random = unifrnd(0,1:6,[1 6])
random =
0.5194 1.6619 0.1037 0.2138 2.6485 4.0269
random = unifrnd(0,1,2,3)
random =
0.0077 0.0668 0.6868
0.3834 0.4175 0.5890