LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extract 2D array element

Hi guys assuming I have a 2D array with 3 element.

 

e.g 280 400 784

 

How do I extact element 0 and 1 separately.

 

 

0 Kudos
Message 1 of 5
(3,970 Views)

Hi Nextal,

 

your example describes a 1D array...

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(3,967 Views)

Hi GerW,

 

Sorry, I only type out a row.

 

It should be like this:

e.g:

280 400 784

270 450 744

299 401 755

         .

         .

         .

         .

         .

 

If I only want row 1 element 0 and element 1. How should I do that?

 

0 Kudos
Message 3 of 5
(3,961 Views)

Hi Nextal,

 

either:

- index row 1, then index the elements from the resulting 1D array

- wire both indices to get the needed elements

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(3,957 Views)

To expand on Gerd's response, when you wire a 2D array to the array index primitive, there will be more terminals available for you to select the row and/or column index.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 5
(3,937 Views)