LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

In my array there are some values as inf and Nan, Before to save my array I want to eliminate this values. How can I do this?

Solved!
Go to solution

In my esperiments I obtain some values such as inf and Nan, and I want to eliminate this values before to save my array in a file because then I would take the average of these values that are saved in a file

How can I do this?

 

Thanks

0 Kudos
Message 1 of 4
(4,239 Views)

Use autoindexing on a FOR loop and a conditional output terminal. Feed the conditional terminal with the output of the various comparison operations.

0 Kudos
Message 2 of 4
(4,235 Views)
Solution
Accepted by topic author Robbie89

Here's a quick example:

 

 

 

Make sure that you use Not A Number/Path/Refnum? Function, because direct comparisons with e.g. a NaN diagram constant might give surprising (to some) results. For example of you think you could add a NaN to the array diagram constant and eliminate some code, it will not work right.

 

 

(Of course if you have an ancient LabVIEW version, you might not have the conditional tunnel. In that case, it would require a little bit mode code)

Message 3 of 4
(4,230 Views)

It might be better to find the root cause of the bad data instead.  Better to fix the problem than treat the symptoms.  Besides, depending on what you find, it might be that you are actually missing real data!

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 4
(4,206 Views)