How to remove specific portion of the matrix?
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Bipin B
el 26 de Mzo. de 2016
Editada: Azzi Abdelmalek
el 26 de Mzo. de 2016
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 comentarios
Respuesta aceptada
Azzi Abdelmalek
el 26 de Mzo. de 2016
Editada: Azzi Abdelmalek
el 26 de Mzo. de 2016
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!