Randomly makes matrix rows as one vector
1 次查看(过去 30 天)
显示 更早的评论
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].
0 个评论
采纳的回答
per isakson
2015-1-19
Hint
M = magic( 7 );
R = M( randperm(7), : );
2 个评论
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".
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!