Index a 2D matrix from a 2D matrix
2 次查看(过去 30 天)
显示 更早的评论
回答(1 个)
Arash Rabbani
2019-11-12
Well you can simply do this without a loop:
A=rand(600,1000);
B=A(1:51,1:51);
But if you need it to use loops
B=zeros(51);
for ii = 1:51
for jj = 1:51
B(ii,jj)=A(ii,jj);
end
end
3 个评论
Matt J
2019-11-12
Perhaps you should be looking at conv2() ?
As I also mentioned in your duplicate post here,
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!