Remove Zeros Matrix on 3D Matrix

조회 수: 16 (최근 30일)
audi rachman
audi rachman 2022년 1월 8일
댓글: audi rachman 2022년 1월 8일
I have Matrix A twhich is a 3D matrix that contain zeros matrix, How to delete the zeros matrix?
here i attach the example of my matrix.
the result that i want is matrix A should be (2,3,3)

채택된 답변

Matt J
Matt J 2022년 1월 8일
val = val(:,:, any(val,[1,2]) )
  댓글 수: 1
audi rachman
audi rachman 2022년 1월 8일
Thank you this one answering my question

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

추가 답변 (1개)

Torsten
Torsten 2022년 1월 8일
편집: Torsten 2022년 1월 8일
function main
val = rand(2,3,4)
val(:,:,3) = []
end

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by