Exclude NaN cells from a cell array
显示 更早的评论
I have a cell array of n number of rows and one column. Each row contains an array.
I want to exclude these NaN cells or copy this cell array in a new one with skipping the NaN cells in the original.

采纳的回答
更多回答(1 个)
David Hill
2020-9-6
编辑:David Hill
2020-9-6
c=[];
for k=1:length(yourCell)
if ~isempty(yourCell{k})
c=[c,k];
end
end
newCell=yourCell(c);
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!