MATLAB: Problem with the size of randperm(n)

randperm

i should run a data of a matrix of [1055×98] involving the rn=randperm(n) however, it can't be as it says:
Attempted to access rn(1056,1);index out of bounds because size(rn)=[1055,1]
do i have problem with the size of rn? if it is, how to set a new one ?

Best Answer

set iteration as 1:max(size(rn))