p=randperm(n)
产生1~n的随机序列
>> randperm(10)
ans =
6 3 7 8 5 1 2 4 9 10
p = randperm(n,k)
产生1~n中k个随机数,不重复
>> randperm(10,5)
10 7 4 2 3