LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

generating a Nan result for 'cropping' bits off 3d graphs

Solved!
Go to solution

Hi, i'm trying to take a 2d array of I32 numbers, sellect a back ground value say 131586, that easy to detect them but the bit i'm having problem with is actaully setting the occurances into Nan so plotting them on a surface graph will leave holes which will better show my data.

 

i've tried the classics like deviding by 0, multiplying by infinity etc... but they all sem to return either +inf or 0.

 

how can i break it?? 

 

both parts attached. (data and VI)

Download All
0 Kudos
Message 1 of 11
(3,567 Views)

Hi John,

if you have an index of 0, then you don't need the for loop, because you get only one value. The code in the attached picture should work for you.

 

Mike

0 Kudos
Message 2 of 11
(3,563 Views)

Hi John,

 

you know that NaN is a floating point number? And integers have a certain range of definition like I32 = {-2^31...2^31-1}.

 

So you can't have NaNs with integers. You have to use floats instead!

 

Btw. instead of calculation you can also wire a NaN constant...

Message Edited by GerdW on 08-26-2009 01:14 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 11
(3,562 Views)

a NaN constant is exaclty what i'm looking for, is there one in the base package?

-i've looked but no luck.

0 Kudos
Message 4 of 11
(3,550 Views)
Solution
Accepted by topic author John Pierson

ah ha, sometimes fiddling does work.

 

you just simply type 'NaN'  into the numerical are, but it has to be done in DBL for some reason.

0 Kudos
Message 5 of 11
(3,542 Views)

Hi John,

 

"it has to be done in DBL for some reason"

 

Well, as I wrote before: "NaN is a floating point number" Smiley Wink

Message Edited by GerdW on 08-26-2009 02:23 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 11
(3,531 Views)

fair point.

 

(wearing hat of shame)

0 Kudos
Message 7 of 11
(3,526 Views)

Question: i'm reading all files in the foulder, how can you exclude the thumbs.db one from the collected list?

The filter seems to allow ones with specific names through, but i want to exclude one.

can that be done with delete from array?

0 Kudos
Message 8 of 11
(3,508 Views)

(answering own question)

 

Yes you can: use 'Search Array' then use its index into 'delete from array' and done

Winner!

0 Kudos
Message 9 of 11
(3,505 Views)

John Pierson wrote:

(answering own question)

 

Yes you can: use 'Search Array' then use its index into 'delete from array' and done

Winner!


 

... and for the bonus points...

 

If you have multiples to delete, find them all ahead of time then start deleting with the max index and work your way down. If done the other way, your indexes will change after each delete.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 11
(3,501 Views)