LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Remove NaN

Solved!
Go to solution

How do i remove the NaN in "output/input" array. Also i need to display the top column of "200077670" array like "2000776729".

Download All
0 Kudos
Message 1 of 40
(12,224 Views)

When you divide a 0 by 0 it will give you NaN. Check the values coming in the denominator is a non-zero value since you are trying to calculate percentage (I Guess).

 

Good Luck.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 40
(12,211 Views)

Some of my denominator has values. Is it possible to display it in "0" instead of NaN for both non values and with values? 

Message 3 of 40
(12,187 Views)
yes you have to check the values as NaN if true pass 0 else pass the value. You can perform this inside the for loop.
-----

The best solution is the one you find it by yourself
0 Kudos
Message 4 of 40
(12,182 Views)

something like this?? not very good in this...new to LV

0 Kudos
Message 5 of 40
(12,167 Views)

I use this to remove NaN from my arrays, hope this helps.

 

Example_VI_BD.png


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 6 of 40
(12,160 Views)

Thanks Smiley Happythat was good but i am required to show the "0" array instead of removing itSmiley Frustrated

0 Kudos
Message 7 of 40
(12,157 Views)

well then just replace the "delete from array" primitive with a "replace array subset primitive" or better with an inplace structure.

 

Example_VI_BD.png


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 8 of 40
(12,152 Views)
Solution
Accepted by topic author nyp123

I generally use the following method. 1st one replace the NaN with 0 and the 2nd removes the NaN.

 

Array_NaN remove.png

 

Good Luck.

-----

The best solution is the one you find it by yourself
Message 9 of 40
(12,143 Views)

you'd be slower on large arrays 😛


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 10 of 40
(12,140 Views)