LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array size

Solved!
Go to solution

For example, I have 3 1d array with with different size.  I combined them and make them into a 2d array.  When I index the shortest original 1d array out of the 2d aray, the size is now equal to the rest of the original 1d arrays.  Is there an easy way to preserve the dimension?  i don't want to padding.  thanks.

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 1 of 6
(4,090 Views)

In a 2D array, all rows or colums need to be the same lenght.

 

You can bundle each 1D array and make them into a 1D array of clusters, each containing a 1D array of variable lenght.

 

 

 

(Here's an example using "build cluster array").

 

You could also encode the lenght of each row prepended as the first element.

Message 2 of 6
(4,085 Views)

there is a feature request for ragged arrays

_____________________________
- Cheers, Ed
Message 3 of 6
(4,081 Views)

It is hard to do that bundle, since each of the 1d array is genearated in a for loop.  is there an easy way to build a cluster of arrays in a loop? 

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 4 of 6
(4,069 Views)
Solution
Accepted by jyang72211

Why is this hard? Simply insert a bundle function of height=1 before autoindexing at the right loop boundary.

 

 

Message 5 of 6
(4,062 Views)

You are right.  Thanks for clarifying.  An array of cluster array.  I see.

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 6 of 6
(4,046 Views)