i have a column matrix with zeros and ones..please give me the comment to find number of zeros in that column
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
i have a column matrix with zeros and ones..please give me the comment to find number of zeros in that column
0 commentaires
Réponses (1)
Andrei Bobrov
le 24 Sep 2012
A = rand(10,1) > .6; % The initial vector - column
out = sum(~A);
or
out = nnz(~A);
1 commentaire
Voir également
Catégories
En savoir plus sur Special Functions 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!