find NaN values is cell array

Viewed 14435

lets assume I have the following array:

a = {1; 'abc'; NaN}

Now I want to find out in which indices this contains NaN, so that I can replace these with '' (empty string).

If I use cellfun with isnan I get a useless output

cellfun(@isnan, a, 'UniformOutput', false)

ans = 
[          0]
[1x3 logical]
[          1]

So how would I do this correct?

3 Answers
Related