Find non-zero elements in a 3-D matrix
Ältere Kommentare anzeigen
Hi,
I have a 3-D matrix containing some non-zero numerical values.I want to find the indices of these non-zero elements.
I know find() can give me row and column, but it doesn't work for a 3-D matrix. Is there another function I can use?
1 Kommentar
Mehri Mehrnia
am 20 Dez. 2021
You can use nnz(matrix), it gives you number of all non-zero elements.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!