How can I select all the nonzero elements of a matrix and give out a matrix?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
José-Luis
am 26 Okt. 2012
And regarding your previous question: don't use globals, you will save someone (probably yourself) a world of hurt in the future.
Akzeptierte Antwort
Weitere Antworten (2)
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping 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!