i =
Ranint([dim],n)
Choose "dim" random integers in the range 1:n.
For historical reasons, the usage is a little weird. If you omit the dim
argument, then a single random integer is drawn from the range 1:n.
Also see
Randi.
Psychtoolbox/PsychProbability/Ranint.m