LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to kick all NaN values from array and create a new array of those values?

Solved!
Go to solution

Hello! I have an array which has both numbers (DBL) and NaN values. What I want, is to remove NaN values and have an array containing all other numbers. How to do that?

I don't need to replace the NaN with 0 or any other number as in this KB example (https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019KwWSAU), but to actually remove those.

 

Please, explain, how to? 

 

P.S: Using LabView 2015 SP1

0 Kudos
Message 1 of 3
(1,301 Views)
Solution
Accepted by topic author YePererva

Auto-index on a FOR loop and use a conditional output tunnel. Use the is NaN? comparison function, and invert it for the condition. (Note that e.g. an equal comparison with e.g. NAN constant would fail, because NaN is not equal NaN)

Message 2 of 3
(1,285 Views)
Solution
Accepted by topic author YePererva

@altenbach wrote:

Auto-index on a FOR loop and use a conditional output tunnel. Use the is NaN? comparison function, and invert it for the condition. (Note that e.g. an equal comparison with e.g. NAN constant would fail, because NaN is not equal NaN)


Like this:

 

wiebeCARYA_0-1676912121992.png

 

0 Kudos
Message 3 of 3
(1,277 Views)