isnan input arguments of type 'cell'

30 views (last 30 days)
Rahul
Rahul on 28 Jun 2012
Commented: Kavya Ashok on 14 Sep 2016
I am getting a cell error
a={'2' [NaN] '4' '5'}
isnan(a)
Undefined function 'isnan' for input arguments of type 'cell'.
How can I get around this error

Accepted Answer

the cyclist
the cyclist on 28 Jun 2012
cellfun(@isnan,a)
  2 Comments
Kavya Ashok
Kavya Ashok on 14 Sep 2016
This returns the index of a where nan exists. What if you want Nan to be removed from the original array?

Sign in to comment.

More Answers (1)

Debejyo Chakraborty
Debejyo Chakraborty on 20 Jul 2016
Sometimes this may be necessary: b = cellfun(@isnan,a,'UniformOutput',false);

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!