How can I select all the nonzero elements of a matrix and give out a matrix?
조회 수: 1 (최근 30일)
이전 댓글 표시
How can I select all the nonzero elements of a matrix and give out a matrix?
MatrixAo = find(MatrixA(:)~=0)
This only gives the indices back... Is there any better command?
Thanks a lot!
댓글 수: 2
José-Luis
2012년 10월 26일
And regarding your previous question: don't use globals, you will save someone (probably yourself) a world of hurt in the future.
채택된 답변
추가 답변 (2개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!