Find NaN in a cell array and only delete the NaNs
Show older comments
How can I delete NaN s from a cell array (only the NaN elements not the whole column or row)?
Accepted Answer
More Answers (2)
madhan ravi
on 11 Apr 2019
C(cellfun(@(x)any(isnan(x)),C))=[]
2 Comments
madhan ravi
on 11 Apr 2019
Matrices cannot have holes.
MatlabUser17
on 11 Apr 2019
Edited: MatlabUser17
on 11 Apr 2019
Pruthvi G
on 12 Mar 2020
Data(cellfun(@(cell) any(isnan(cell(:))),Data))={''};
Categories
Find more on NaNs in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!