matrix
1 回表示 (過去 30 日間)
古いコメントを表示
Hi, I have a very large matrix. I want to know how many positive elements I have in the matrix, and how many negative elements (non-zero).
Thanks
0 件のコメント
採用された回答
Oleg Komarov
2012 年 5 月 28 日
idx = A < 0;
nnz( idx) % negative
nnz(~idx) % positive (including 0)
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!