| Statistics Toolbox | ![]() |
Random numbers from the continuous uniform distribution
Syntax
Description
generates uniform random numbers with parameters R = unifrnd(A,B)
A and B. Vector or matrix inputs for A and B must have the same size, which is also the size of R. A scalar input for A or B is expanded to a constant matrix with the same dimensions as the other input.
generates uniform random numbers with parameters R = unifrnd(A,B,m)
A and B, where m is a 1-by-2 vector that contains the row and column dimensions of R.
generates uniform random numbers with parameters R = unifrnd(A,B,m,n)
A and B, where 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
See Also
unifcdf, unifinv, unifpdf, unifstat
| unifpdf | unifstat | ![]() |