Rearranging Array Rows into Multiple Blocks while Maintaining the Old Order
2 次查看(过去 30 天)
显示 更早的评论
How can I rearrange an array from alternating rows to multiple blocks, maintaining the order of the rows?
2 个评论
madhan ravi
2019-3-18
please illustrate with a input and the desired output as text instead of picture
采纳的回答
Jos (10584)
2019-3-18
You should learn about indexing, one of the most essential aspects of Matlab:
M = randi(4,10,5) ; M(:,1) = 1:size(M,1) % example data
M2 = M([1:2:end 2:2:end], :) % re-ordering the rows
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Cell Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!