필터 지우기
필터 지우기

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 CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by