Remove missing from cell array
Mostra commenti meno recenti
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}
Risposte (1)
madhan ravi
il 30 Mag 2019
yourcell(cellfun(@ischar,C))
3 Commenti
madhan ravi
il 30 Mag 2019
Modificato: madhan ravi
il 30 Mag 2019
Read this once again
Try the above see if it satisfies your need else show what missing data contains
since I don’t know because I’m not at the latest stand.
Use 'isempty' instead of @ischar if missing contains an empty scalar.
Gian Pietro Luca
il 30 Mag 2019
Andreas Martin
il 14 Lug 2020
Yes, in that case it doesn't work. Try then this instead:
C( cellfun( @(c) isa(c,'missing'), C ) ) = {[]};
Categorie
Scopri di più su Cell Arrays in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!