Cell rows/columns size

조회 수: 11 (최근 30일)
Memo Remo
Memo Remo 2020년 5월 20일
댓글: Memo Remo 2020년 5월 20일
Hi,
I have a m by n cell in which some rows has less than 10 strings and the remaining elements are empty ([ ]). I now want to determine how many strings are there in each rows. If this cell was an array I could use "nonzeros(A(i,:))" to determine this but I don't know how to do this for a cell. Please help me fix this problem.
Thanks.

채택된 답변

Fangjun Jiang
Fangjun Jiang 2020년 5월 20일
c={'12',[],'adjk';'jkjf','j;',[]}
b=cellfun(@isempty,c)
  댓글 수: 1
Memo Remo
Memo Remo 2020년 5월 20일
Hi Fangjun,
Thanks for your help. This works.
Best,
M

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by