Randomly makes matrix rows as one vector

조회 수: 1 (최근 30일)
Abe
Abe 2015년 1월 19일
댓글: Abe 2015년 1월 22일
Hello all, I would like to work on a marix that should be converted to on vector (by rows), but my question here is how I can convert these rows in my matrix to one vector but randomly sorting, I mean that it should be not [row1, row2,.....] but like for example [row2, row8, ... so on].

채택된 답변

per isakson
per isakson 2015년 1월 19일
Hint
M = magic( 7 );
R = M( randperm(7), : );
  댓글 수: 2
Roger Stafford
Roger Stafford 2015년 1월 19일
편집: Image Analyst 2015년 1월 19일
Add on the line
M_new = reshape(R',1,[]);
to make it "on(e) vector".
Abe
Abe 2015년 1월 22일
Thank you guys for these ideas.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by