randiUniformly distributed pseudo-random integer
randi(imax)imax should be a real positive integer scalar.imax}. randi(imax,n)imax should be a real positive integer scalar.n-by-n matrix of uniformly distributed pseudo random numbers taken from the set {1, 2, ..., imax}.n should be a real non-negative integer scalar. If n is zero, it returns an empty array.randi(imax,s1,s2,...,sn)imax should be a positive integer scalar.s1, s2, ..., sn]. The array contains uniformly distributed pseudo-random numbers taken from the set {1, 2, ..., imax}.s1, s2, ..., sN should be real non-negative integer scalars. If one of s1, s2, ..., sN is zero, it returns an empty array.randi(imax,sizeVec)imax should be a positive integer.imax}. The array's size is specified by the size vector sizeVec.sizeVec should contain real non-negative elements. If an element of sizeVec is zero, it returns an empty array.r1 = randi(5, 3, 4, 5);
size(r1)
r2 = randi(5, [3 4 5]);
size(r2)
ans =
3.0000 4.0000 5.0000
ans =
3.0000 4.0000 5.0000