Need help using the count function
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Raul Castillo
le 9 Oct 2019
Réponse apportée : Walter Roberson
le 9 Oct 2019
hi lets say i have an array 4x5 and it is compossed of 0's and 1's
as so a=[ 1 0 1 0 1;
1 1 0 1 1;
0 1 0 1 0;
1 0 1 0 1;]
and i want to count the zeros in each collumn
so im writing count(a,0) but i am getting erros ive read the material but dont understand what the string array means
0 commentaires
Réponse acceptée
Walter Roberson
le 9 Oct 2019
sum(a == 0, 1)
count() is primarily a method for processing string() datatype.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Types 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!