How to remove specific portion of the matrix?
9 ビュー (過去 30 日間)
古いコメントを表示
0 0 0 0 0 0 0 0 0
0 1 4 8 12 16 14 5 0
0 3 12 24 36 48 42 15 0
0 4 16 32 48 64 56 20 0
0 4 16 32 48 64 56 20 0
0 4 16 32 48 64 56 20 0
0 3 12 24 36 48 42 15 0
0 1 4 8 12 16 14 5 0
0 0 0 0 0 0 0 0 0
This is my output matrix of size 9x9. But my desired output matrix is only 5x5. It starts from (3,3) to (7,7) from which the output image can be of size 5x5. I tried reshaping. But got some errors. I am just starting to learn Matlab. I tried REMOVEROWS function. But I am not getting the desired output. My desired output should be something like this.
12 24 36 48 42
16 32 48 64 56
16 32 48 64 56
16 32 48 64 56
12 24 36 48 42
Can anyone please help me?
0 件のコメント
採用された回答
Azzi Abdelmalek
2016 年 3 月 26 日
編集済み: Azzi Abdelmalek
2016 年 3 月 26 日
A=[0 0 0 0 0 0 0 0 0
0 1 4 8 12 16 14 5 0
0 3 12 24 36 48 42 15 0
0 4 16 32 48 64 56 20 0
0 4 16 32 48 64 56 20 0
0 4 16 32 48 64 56 20 0
0 3 12 24 36 48 42 15 0
0 1 4 8 12 16 14 5 0
0 0 0 0 0 0 0 0 0]
B= A(3:7,3:7)
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!