02-12-2010 03:29 PM
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
02-12-2010 03:36 PM
02-12-2010 03:38 PM
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.
02-12-2010 03:48 PM
02-12-2010 03:52 PM - edited 02-12-2010 03:53 PM
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
02-12-2010 05:23 PM
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
02-12-2010 05:28 PM - edited 02-12-2010 05:28 PM
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?