how to count the number of empty cells in an array?
35 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
How to count the empty cells in the attached array?
Regards,
0 commentaires
Réponse acceptée
Muthu
le 20 Avr 2020
Hello Sarah,
You can count the empty cells using the following commands
N_nonempty = find(~cellfun(@isempty,Out));
count_empty = length(Out)-length(N_nonempty);
2 commentaires
Stephen23
le 21 Avr 2020
Much simpler and more efficient just to count the output of cellfun directly:
>> nnz(cellfun(@isempty,Out))
ans = 216
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Matrices and Arrays 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!