Delete rows with NaN for a cell array
11 次查看(过去 30 天)
显示 更早的评论
I want to remove the rows that have NaN and still keep the dimension of the array intact.
[ NaN] [ NaN] [ NaN] [ NaN]
[ NaN] [ NaN] [ NaN] [ NaN]
'Total RADIO Drops' 'Total Drops' 'CC DCR (%)' 'RADIO DCR (%)'
Above is just an example, I have over a thousand rows.
The only problem I have now is removing rows which have NaN and string together
Thank you
采纳的回答
更多回答(1 个)
Andrei Bobrov
2013-6-26
编辑:Andrei Bobrov
2013-6-26
A - your cell array
out = A(any(cellfun(@(x)any(~isnan(x)),A),2),:);
ADD
out = A(all(cellfun(@(x)any(~isnan(x)),A),2),:);
4 个评论
YING CONG XIAO
2021-4-21
hi Andrei,
how to specify the range in this fun:
out = A(any(cellfun(@(x)any(~isnan(x)),A),2),:);
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Object Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!