Find non-zero elements in a 3-D matrix
이전 댓글 표시
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
Mehri Mehrnia
2021년 12월 20일
You can use nnz(matrix), it gives you number of all non-zero elements.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!