Hi, I have a 3D matrix with a size of 256x256x256. I would like to delte the first plane (so in 2D) seen from the top, the bottom, from left and from right. How can I compute this using matlab?

댓글 수: 1

Zehra Ese
Zehra Ese 2023년 5월 3일
So at the end I should have a matrix size of 254x254x254.

댓글을 달려면 로그인하십시오.

 채택된 답변

John D'Errico
John D'Errico 2023년 5월 3일
편집: John D'Errico 2023년 5월 3일

0 개 추천

Sometimes it is simpler to take what you want, than it is to delete what you don't want. Here is a matrix:
A = rand(256,256,256);
Clearly you know the size.
B = A(2:255,2:255,2:255);
Which elements are no longer present in B compared to A? If you don't want to create a new matrix, then just assign the result back into the variable A.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품

릴리스

R2023a

태그

질문:

2023년 5월 3일

편집:

2023년 5월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by