Counting elements of a cell
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
James Tursa
2015-6-16
编辑:James Tursa
2015-6-16
sum(~cellfun(@isempty,dataflows))
cellfun(@numel,dataflows)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!