Filter löschen
Filter löschen

Counting elements of a cell

1 Ansicht (letzte 30 Tage)
Yongmin
Yongmin am 16 Jun. 2015
Kommentiert: Yongmin am 16 Jun. 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.

Akzeptierte Antwort

James Tursa
James Tursa am 16 Jun. 2015
Bearbeitet: James Tursa am 16 Jun. 2015
sum(~cellfun(@isempty,dataflows))
cellfun(@numel,dataflows)

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by