LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

insert 2d array into 1d array

Hello all,

 

           I wanting to insert 2d array into 1D array. For example if i have a 2D array that looks like this

 

1 2      into 1D with 6 columns filled with 2d data.  Basically array in an array.Is this possible?                                     

1 2

3 4      

5 6

7 8

 

 

 

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

I don't think you can have an array of array in LabVIEW.

 

Ben

0 Kudos
Message 2 of 7
(3,484 Views)

Can you give an example what you want it to look like after the "insert"?

 

I doubt you can do what you want based on what you are describing because LabVIEW can't have Arrays of Arrays.  Though I believe you can create an Array of Clusters of Arrays.

0 Kudos
Message 3 of 7
(3,481 Views)
I have a 2d array as shown in the attached VI and would like to insert the 2d array elements into 1D array. Hope this helps.
0 Kudos
Message 4 of 7
(3,471 Views)

Hi gsajja,

 

we all know how 1d or 2d arrays look like in LabVIEW. You should show an example with some actual values in the array control/indicator...

 

One way to make a 1d array from a 2d one is in the attachment.

 

Edit:

When you want the 2d array as an element of the 1d array it becomes a 3d one Smiley Wink

Message Edited by GerdW on 02-12-2010 10:53 PM
Best regards,
GerdW


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

It complicates things a bit, but you can have an array of clusters that contain a 2d array.

 

But now to get to the data, you need to index the 1D array, unbundle the other array from the cluster and then access the data.

 

It is possible, but not a recommended way. Depending on what you are attempting to do, there are other data structures that are more efficient.

 

     Rob

0 Kudos
Message 6 of 7
(3,430 Views)

I'm sure it would help everyone if you could describe what you would like to achieve, that is besides your statement so far of inserting a 2D array into a 1D array. What is the problem you are trying to solve? What is the meaning of the data? If we know that we might be able to make some suggestions about how to organize your data to achieve what you want.

 

Silly question but would a 3D array solve your problem?

Message Edited by Mark Yedinak on 02-12-2010 05:28 PM


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 7 of 7
(3,427 Views)