LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
tst

Add a "Concatenate Indexing" option for arrays leaving loops

Status: Completed
Available in LabVIEW 2012

When an array leaves a loop with indexing enabled, you get an array which has one more dimension, but quite often you want to concatenate the data to an array with the same number of dimensions.

 

If the subarrays have the same length, you can use reshape array, but usually they don't and you need to do something like below.

 

It would be very useful if output tunnels for arrays had an "Enable Concatenate Indexing" option as well, as depicted below, which would do this.

 

 Concat Indexing.PNG

 


___________________
Try to take over the world!
24 Comments
RavensFan
Knight of NI
Not exactly Chris, you need to allocate the memory either before the loop begins, or while it is running.  You can't allocate the memory at the end because you have to be able to store the data somewhere that each iteration may or may not be generating. Smiley Wink
Message Edited by Ravens Fan on 05-21-2010 08:19 PM
GregSands
Active Participant

I like this idea, but have one question: how would this work with a parallelized loop?  I imagine there could be issues with knowing how to reassemble the results from each thread into the final array.

tst
Knight of NI Knight of NI
Knight of NI

Let's let NI figure that one out. Worst case scenario - using concat indexing means you can't parallelize a loop.


___________________
Try to take over the world!
JackDunaway
Trusted Enthusiast

For what it's worth, in my applications, I would give up parallelization for concatenated indexing, but I bet there's some smart guys over there who can figure it out and make both work.

Ray.R
Knight of NI

I would say that out of all the 25 ideas that I recently read, this one tops the list!

 

NI:  we need this!  This is what will make LabVIEW greater!

 

Good one Yair!

maramosc
Member

Great Idea!, it also annoys me to have to add all of the extra code just to concatenate the results.

jordankuehn
Member

Agreed.  If the build array primative will let you do it, the for loop should as well.

The Colex Group
Lead Software Engineer
Certified LabVIEW Developer
Jason_Harrigan
Member

While this does add complexity and additional options, the amount of code it saves is significant and the need is often encountered. So I say it should be implemented.

G-Money
NI Employee (retired)
Status changed to: In Development
 
tst
Knight of NI Knight of NI
Knight of NI

Great! I just hope this can also be combined with the conditional auto-indexing idea which is now also in development as discussed earlier in the comments.


___________________
Try to take over the world!