Remove missing entries from nested cell array
3 次查看(过去 30 天)
显示 更早的评论
Hello,
I have a cell array which has string arrray inside like for example below:
and some of the string array have empty/missing contents:
I would like to remove these empty/missing entries from the overall cell_array (temp_vars).
I tried something like:
temp_vars = temp_vars(~cellfun('isempty',temp_vars))
but did not find a solution yet. Any help would be appreciated.
0 个评论
回答(2 个)
Voss
2023-11-3
% make a cell array of string arrays with some missing elements:
str = ["some",missing,"string"];
C = repmat({str},1,3)
% remove the missing elements:
C = cellfun(@rmmissing,C,'UniformOutput',false)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!