random_pos=[131 + 131];
↑
错误: 运算符的使用无效。
你是想表述1-31的区间还是什么
a=[1:31,1:31]
你好,如果需要的是1到31的整数抽样,请用
p = randperm(31,1)