Remove Zeros Matrix on 3D Matrix

15 visualizzazioni (ultimi 30 giorni)
audi rachman
audi rachman il 8 Gen 2022
Commentato: audi rachman il 8 Gen 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)

Risposta accettata

Matt J
Matt J il 8 Gen 2022
val = val(:,:, any(val,[1,2]) )

Più risposte (1)

Torsten
Torsten il 8 Gen 2022
Modificato: Torsten il 8 Gen 2022
function main
val = rand(2,3,4)
val(:,:,3) = []
end

Categorie

Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by