matrix
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
Oleg Komarov
il 28 Mag 2012
idx = A < 0;
nnz( idx) % negative
nnz(~idx) % positive (including 0)
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Sparse Matrices in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!