MATLAB: Replacing NaN with zeros in a cell column of strings

cellnan

Dear all,
I have this column
A={[NaN]
[NaN]
[NaN]
[NaN]
[NaN]
'ka'
[NaN]
[NaN]
'jdfksjkg'
'ldsiu'
[NaN]
[NaN]
'jdfkkg'
'jdfkkg'
};
and I want to replace the NaN with zeros that is ,
A={[0]
[0]
[0]
[0]
[0]
'ka'
[0]
[0]
'jdfksjkg'
'ldsiu'
[0]
[0]
'jdfkkg'
'jdfkkg'
};
Is there a way of doing that in matlab?
Thanks in advance

Best Answer

Are the NaNs the only non-CHAR elements? Then:
A(~cellfun('isclass', A, 'char')) = {0};