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.
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.