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에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!