Uniformly distributed pseudorandom integers
- r = randi(imax,n)
returns an n-by-n matrix containing pseudorandom integer values drawn from the discrete uniform distribution on 1:imax.
- r = randi(imax,m,n) / r = randi(imax,[m,n])
returns an m-by-n matrix.
The sequence of numbers produced by randi is determined by the settings of the uniform random number generator that underlies rand, randn, and randi.