How to identify the position in which a value is NaN
7 views (last 30 days)
Show older comments
I want to be able to identify the position in which a value is NaN
If I have:
x = [1 NaN 3 4 5 NaN 7 8 9 10]
In which the second and sixt position are NaN
something that gives me an answer = [ 2 , 6 ] is what I am looking for.
I usually use the "find" such as find(x==3) would return = 3 (because it is at the third position), but now I want to apply it for NaN
Not sure how that could be done, wonder if anybody can help me. Thanks in advance!
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!