Remove Zeros Matrix on 3D Matrix

4 Ansichten (letzte 30 Tage)
audi rachman
audi rachman am 8 Jan. 2022
Kommentiert: audi rachman am 8 Jan. 2022
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)

Akzeptierte Antwort

Matt J
Matt J am 8 Jan. 2022
val = val(:,:, any(val,[1,2]) )
  1 Kommentar
audi rachman
audi rachman am 8 Jan. 2022
Thank you this one answering my question

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Torsten
Torsten am 8 Jan. 2022
Bearbeitet: Torsten am 8 Jan. 2022
function main
val = rand(2,3,4)
val(:,:,3) = []
end

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by