Effacer les filtres
Effacer les filtres

Counting elements of a cell

1 vue (au cours des 30 derniers jours)
Yongmin
Yongmin le 16 Juin 2015
Commenté : Yongmin le 16 Juin 2015
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.

Réponse acceptée

James Tursa
James Tursa le 16 Juin 2015
Modifié(e) : James Tursa le 16 Juin 2015
sum(~cellfun(@isempty,dataflows))
cellfun(@numel,dataflows)
  1 commentaire
Yongmin
Yongmin le 16 Juin 2015
Thank you for your answer.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by