convert double NaN to string NaN
Ältere Kommentare anzeigen
Hi
I have a cell array with NaN as shown in the image. How can I convert NaN to string NaN meaning instead of of seeing NaN in the array, I want to see "NaN".
I have tried this: TC(cellfun(@(x) any(isnan(x)),TC,'UniformOutput',false)) = {"NaN"}; but no success.
Any help is appreciated.

Akzeptierte Antwort
Weitere Antworten (1)
Try num2str
a = {nan 1 nan};
cellfun(@num2str,a,'UniformOutput',0)
1 Kommentar
Daneisha Blair
am 24 Aug. 2021
Kategorien
Mehr zu Data Type Conversion finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!