Counting elements of a cell
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello, I have the following cell array (1000x1 cell) :
dataflows =
[]
[]
26591731
[]
[12x1 double]
[]
[]
[2262542; 2262543; 2262543]
...
Now I'd like to compute the number of elements in the cell that are not empty. I also want to compute the number of elements contained in a cell element.
Would you please let me know how to do them easily? Thanks in advance.
0 Commenti
Risposta accettata
James Tursa
il 16 Giu 2015
Modificato: James Tursa
il 16 Giu 2015
sum(~cellfun(@isempty,dataflows))
cellfun(@numel,dataflows)
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Matrix Indexing in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!