How to crop some matrix row
2 次查看(过去 30 天)
显示 更早的评论
How do I crop a 105x41 matrix to get a 41x41 matrix. I want to crop the top and bottom rows to get the central 41x41 matrix. Something like opposite of padarray?
0 个评论
采纳的回答
Andrei Bobrov
2014-9-4
A = randi([0 255],105,41,'uint8'); % your matrix
i1 = ceil(size(A,1)/2);
out = A(i1 - 20 : i1 + 20,:);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!