LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Select specific row from array, then subsequent rows based on input

Solved!
Go to solution

Hello,

 

I have an array that contains 2 columns.  I would like to pick a specific row from the array based on the entry from column 1.  Also based on the # registers input, to pick subsequent rows from column 2.

 

2021-05-03_17-30-47.png

 

Here is an example:

 

For the above entries in the block diagram, I would like to get this output:  0102 followed by the 2 rows in column 2: 0001 1003.  The overall output will be 010200011003.

 

Any help will be greatly appreciated!

 

0 Kudos
Message 1 of 2
(116 Views)
Solution
Accepted by topic author hiNI

Index the 2d array by columns, search column one for match(es) and get the index/indices. Loop over the index/indices and get the array subset from column 2. Transpose array, or concat instead of index as desired.

 

Search 2d array.png

 

 

Message 2 of 2
(73 Views)