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!