Remove missing from cell array
이전 댓글 표시
I have used readcell to read tabular data.
How can the missing elements be removed?
6×1 cell array
{'a' }
{'b' }
{'c' }
{'d' }
{1×1 missing}
{1×1 missing}
답변 (1개)
madhan ravi
2019년 5월 30일
yourcell(cellfun(@ischar,C))
댓글 수: 3
madhan ravi
2019년 5월 30일
편집: madhan ravi
2019년 5월 30일
Read this once again
Try the above see if it satisfies your need else show what missing data contains
since I don’t know because I’m not at the latest stand.
Use 'isempty' instead of @ischar if missing contains an empty scalar.
Gian Pietro Luca
2019년 5월 30일
Andreas Martin
2020년 7월 14일
Yes, in that case it doesn't work. Try then this instead:
C( cellfun( @(c) isa(c,'missing'), C ) ) = {[]};
카테고리
도움말 센터 및 File Exchange에서 Cell Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!