How do we extract a 2D matrix out of a 2D matrix?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a 2D matrix of 600x1000 and I want to create a nested loop to extract 51x51 matrix data. How can we do that? Thanks.
댓글 수: 0
답변 (1개)
Walter Roberson
2019년 11월 12일
for row_index = 1 : number_of_rows_to_transfer
for column_index = 1 : number_of_columns_to_transfer
TheOutputArray(row_index, column_index) = TheInputArray(row_index+row_offset, column_index+column_offset);
end
end
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!