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 で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!