MATLAB: How to treat NaN elements in a cell array as a string in any release of MATLAB

MATLABxlsread

I have a cell array that consists of both numeric and string data. Some of the numeric data are NaNs. I want to replace the NaN values by a string.

Best Answer

You may use the attached M-function for this purpose.
NAN2STRCELL accepts a cell array as input. It searches for NaN elements and replaces them with the string 'NaNstring'. The output is the modified cell array.