dimanche 11 janvier 2015

Matlab - Shuffle columns of a matrix while keeping the elements in the same columns

I have a matrix containing 3 columns of data (say x,y,z columns and 500 rows)


I want to shuffle the elements within this matrix while keeping the associated data together


I.e.


Keep the 3 pieces of data in the first row together, keep the 3 pieces of data in the second row together and so on, while at the same time shuffling the order such that row 1 might now be in position 15 and row 2 might be in position 4 etc.


I've had a look at randperm but not sure how to implement this.





Aucun commentaire:

Enregistrer un commentaire