04-03-2012 09:16 AM
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.
Solved! Go to Solution.
04-03-2012 09:26 AM - edited 04-03-2012 09:33 AM
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.
04-03-2012 09:29 AM
there is a feature request for ragged arrays
04-03-2012 09:43 AM
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?
04-03-2012 09:49 AM - edited 04-03-2012 09:57 AM
Why is this hard? Simply insert a bundle function of height=1 before autoindexing at the right loop boundary.
04-03-2012 10:03 AM
You are right. Thanks for clarifying. An array of cluster array. I see.