How to split a 3d matrix into sub-3d matrices?

조회 수: 2 (최근 30일)
farhad vaseghi
farhad vaseghi 2020년 8월 3일
How can I split e.g. a a1xb1xc matrix into non-overlapping (neighbouring) smaller matrices a2xb2xc?

답변 (2개)

Bruno Luong
Bruno Luong 2020년 8월 3일
probably you can use
mat2cell
IMO splitting a matrix in cell is rarely a good idea if you want your code works decenly in speed.

Constantino Carlos Reyes-Aldasoro
There is not enough information to be certain about your question, but by addressing your matrices you can create submatrices like this:
BigMatrix = ones(16,16,16);
smallMatrix_1 = BigMatrix(1:8,1:8,1:8);
smallMatrix_2 = BigMatrix(1:8,1:8,9:16);
smallMatrix_3 = BigMatrix(1:8,9:16,1:8);
smallMatrix_4 = BigMatrix(9:16,1:8,1:8);
etc.
  댓글 수: 6
madhan ravi
madhan ravi 2020년 8월 3일
I’m not the original poster, sorry :(

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

카테고리

Help CenterFile Exchange에서 Performance and Memory에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by