randi
- :
R =randi(imax)¶ - :
R =randi([imin imax], n, …)¶ - :
R =randi(…, class)¶ Uniformly distributed pseudorandom integers.
Values are drawn from
1:imaxorimin:imaxusing the generator ofrand. Size arguments are as forrand; class may be"double","single"or an integer class name, with values limited to the range of the class.