Delete rows with NaN for a cell array
14 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Rooy
am 26 Jun. 2013
Kommentiert: YING CONG XIAO
am 21 Apr. 2021
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
Akzeptierte Antwort
Weitere Antworten (1)
Andrei Bobrov
am 26 Jun. 2013
Bearbeitet: Andrei Bobrov
am 26 Jun. 2013
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 Kommentare
YING CONG XIAO
am 21 Apr. 2021
hi Andrei,
how to specify the range in this fun:
out = A(any(cellfun(@(x)any(~isnan(x)),A),2),:);
Siehe auch
Kategorien
Mehr zu Graphics Object Programming finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!