To shuffle the rows of a matrix, you can use RANDPERM
shuffledArray = orderedArray(randperm(size(orderedArray,1)),:);
randperm
will generate a list of N
random values and sort them, returning the second output of sort
as result.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…