I am trying to find the number of nonzero elements I have in a matrix without using the nnz function.
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Steven M
le 27 Avr 2017
Réponse apportée : MH Rahat
le 13 Fév 2022
Is there a way I can use sums or another function to add up the number of nonzero elements in a matrix. I know of the nnz function but I am not allowed to use it on the project I am working on because we haven't learned it in class.
Thank you for your help!
0 commentaires
Réponse acceptée
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Sparse Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!