LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add 2D array at the end of another 2D array


@billko wrote:
I was thinking that the memory would just be "reconsidered" as is the case with a reversed string, but you're saying that manipulating a multi-dimensional array would be more complicated?  In other words, LV would actually have to re-create the data, not "reconsider" it?

Yes, often a transpose can be done without touching the data (just flag it as transposed), depending on what comes next. (e.g. for index array, just swap the indices, for an autoindexing FOR loop, index on rows instead of columns, etc).

 

Since arrays need to be contiguous there is significant reshuffling in memory when appending rows, most likely requiring a brand new allocation for the entire output array anyway. I have no idea what it will do with your three transpose operations... How many allocation dots do you see?

0 Kudos
Message 11 of 14
(300 Views)

Some more information:

The rows are fixed size 6 and the number of colums that are added are also always the same but can be between 10 and 10000. 

But the add will run in a loop and executed very often which means it should be fast.

The reason doing this is to collect measuremt data over 6 channels and display them on a xy-graph. Where x is only 0..arraysize. Each time the new data is added to the array i show the array on the graph. 

0 Kudos
Message 12 of 14
(293 Views)

If this is xy data, consider contracting x and y data into a single complex datatype. XY graphs understand complex arrays directly and will graph IM vs RE.

 

Now all you have is a 1D complex array that you grow over time.

0 Kudos
Message 13 of 14
(288 Views)

Its a 2D array as there a 6 channels that each get new y-data in the loops.

The x data is calculated afterwards. 

0 Kudos
Message 14 of 14
(273 Views)