フィルターのクリア

Counting elements of a cell

1 回表示 (過去 30 日間)
Yongmin
Yongmin 2015 年 6 月 16 日
コメント済み: Yongmin 2015 年 6 月 16 日
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.

採用された回答

James Tursa
James Tursa 2015 年 6 月 16 日
編集済み: James Tursa 2015 年 6 月 16 日
sum(~cellfun(@isempty,dataflows))
cellfun(@numel,dataflows)
  1 件のコメント
Yongmin
Yongmin 2015 年 6 月 16 日
Thank you for your answer.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by