Randomly sorting rows while keeping column relationships the same

조회 수: 26 (최근 30일)
L. Yang
L. Yang 2019년 9월 24일
댓글: L. Yang 2019년 9월 24일
Hi
I have a 30x10 matrix. The columns are the features (10 characteristics) and each row represents a datapoint (30 people). I would like to randomize the order of the rows (aka to shuffle the order that each person is listed) while keeping the row unchanged so that the features for each person are all in the same row. Can someone help me with that please?
thanks

채택된 답변

Michal
Michal 2019년 9월 24일
편집: Michal 2019년 9월 24일
Apermrows = A(randperm(size(A,1)),:)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by