How to crop some matrix row

1 回表示 (過去 30 日間)
Mahi Nazir
Mahi Nazir 2014 年 9 月 4 日
コメント済み: Mahi Nazir 2014 年 9 月 4 日
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?

採用された回答

Andrei Bobrov
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,:);
  1 件のコメント
Mahi Nazir
Mahi Nazir 2014 年 9 月 4 日
Thank you so much! Does exactly what I want

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by