LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2D, 1 column array to a 1D array?

Solved!
Go to solution

Is there any easy way to do this? I can envision a way to do it by using loops, but that seems unnecessary. Maybe a way to transpose 2D array and convert?

 

Thanks

0 Kudos
Message 1 of 5
(5,994 Views)

Hi GV,

 

what about a simple IndexArray function? (Or ReshapeArray?)

Best regards,
GerdW


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

I get index arrays and everything (I think).

 

Say for a 3 x 3 2D array. I know how to index to get what I want (ex. the second column only maybe). I need this single column to be transformed into a 1D array. If I transposed it, it would "look" like a 1D array, but it wouldn't be one. My problem is being able to make a 2D array that is "practically" a 1D array into a type 1D array.

 

Unless I'm missing something key about indexing arrays.

0 Kudos
Message 3 of 5
(5,988 Views)
Solution
Accepted by topic author GV_KawaiiDesu

If you use Index Array one a 2D array, and you enter only ONE of row or column (not both) then you will extract that vector as a 1D array.

index2.png

Message 4 of 5
(5,961 Views)

As a recent example, look at my image posted here. It gets the second column as a 1D array. You would wire a zero to the lower index, leaving the row index unwired. This will get you the first column.

 

All this is explained in the help.

0 Kudos
Message 5 of 5
(5,952 Views)