i have a column matrix with zeros and ones..please give me the comment to find number of zeros in that column
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
i have a column matrix with zeros and ones..please give me the comment to find number of zeros in that column
0 Commenti
Risposte (1)
Andrei Bobrov
il 24 Set 2012
A = rand(10,1) > .6; % The initial vector - column
out = sum(~A);
or
out = nnz(~A);
1 Commento
Vedere anche
Categorie
Scopri di più su Creating and Concatenating 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!