フィルターのクリア

matrix

1 回表示 (過去 30 日間)
Mate 2u
Mate 2u 2012 年 5 月 28 日
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

採用された回答

Oleg Komarov
Oleg Komarov 2012 年 5 月 28 日
idx = A < 0;
nnz( idx) % negative
nnz(~idx) % positive (including 0)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSparse Matrices についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by