From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Positions of non "NaN" elements in a 2d array

Solved!
Go to solution

Hello,

does anyone know, how I can detect the position (row, column) of the non "NaN" elements in this 2D array?
I can "clean" the array to get only non "NaN" elements in a 1d array. But I cannot detect their position in the array. I need the row position (position of Y axis value in a plot), because i have to find the corresponding x-value and use it for a signal processing item.
I hope it is not very difficult to make this and that someone could help me.

thanks

0 Kudos
Message 1 of 7
(3,240 Views)

Hi Sarah,

 

as you work with a 2D array you need two nested FOR loops to autoindex each element. In the inner FOR loop you use the "Not a Number?" function to check the current element. If it is a number you store it's indexes (the loop iterator outputs!) in an output array using conditional output tunnels…

 

This is basic LabVIEW stuff you already should have learned by the experience you gained from visiting the LabVIEW forum!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 7
(3,229 Views)
Solution
Accepted by topic author s.steen

Here is one that uses OpenG Array toolkit. The search array can be coded up easily too.

2d array_percent.png


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
Message 3 of 7
(3,205 Views)

Thanks guys!

0 Kudos
Message 4 of 7
(3,148 Views)

would u please send me the code? it doesn't work here as it should do. I used it for other arrays and I don't get all of the indexes as u showed in your picture.. would be so kind, thank you!


@.aCe. wrote:

Here is one that uses OpenG Array toolkit. The search array can be coded up easily too.

2d array_percent.png


 

0 Kudos
Message 5 of 7
(3,135 Views)

The picture is a snippet. You should be able to drag that to your block diagram directly. if that does not work, save the picture to your PC and then drag it in.

OpenG toolkit can be downloaded using VI Package Manager (ships with LabVIEW 2014 DVDs) or may be downloaded here: http://vipm.jki.net/download


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 6 of 7
(3,123 Views)

got it.. thank you very much!

0 Kudos
Message 7 of 7
(3,114 Views)