Remove missing from cell array
13 次查看(过去 30 天)
显示 更早的评论
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}
2 个评论
回答(1 个)
madhan ravi
2019-5-30
yourcell(cellfun(@ischar,C))
3 个评论
Andreas Martin
2020-7-14
Yes, in that case it doesn't work. Try then this instead:
C( cellfun( @(c) isa(c,'missing'), C ) ) = {[]};
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Cell Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!