Randomly makes matrix rows as one vector

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 日

2 投票

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 件)

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

製品

質問済み:

Abe
2015 年 1 月 19 日

コメント済み:

Abe
2015 年 1 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by