LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Combining 2d Arrays

Solved!
Go to solution

Hey all,

 

I am trying to combine 4 u8 arrays that have been segmented from an image.  It is split horz and vertically.  I was able to do this with a math script node, but it is very slow (200-600 ms).  Anyone have any ideas how I can do this faster?  I was thinking of doing it in c, but I dont want to use dlls.  Any suggestions would be greatly appreciated.  Also, I only have LV 8.2.1. 

Thanks'

Matt

0 Kudos
Message 1 of 5
(4,036 Views)

Use the Build Array function.  Use Concatenate Inputs so a 2-D array becomes a larger 2-D array.  You may also need to use transpose array so that you can concatenate in rows in one case, then concatenate with columns in the next.

 

Or use replace array subset with an array intialized to the final size.  By stretching the bottom of the function down, you can get multiple inputs.  With approriate calculation of the indices you can drop the smaller 2-D arrays right where you need in the larger 2-D array.

 

How big are your arrays?  If you post a VI with the arrays saved in them as controls (with save values as defaults) or constants.  An example could be worked up.

Message 2 of 5
(4,033 Views)
Solution
Accepted by topic author oglakan

Thx Ravens Fan, I was able to get it down to 1-2 ms.  Just did a build on the top and bottom of left and right, then transposed, build again, and then transpose.  Thx again.

 

Matt

0 Kudos
Message 3 of 5
(4,002 Views)

I am also trying to combine 2 2D-arrays.

My data comes from a couple different While loops does it matter where I combine the 2 arrays?

I am new at Labview and could use some help.

 

Thanks

JH

0 Kudos
Message 4 of 5
(3,922 Views)
I don't understand your question.  Perhaps you can post a VI with some example data saved in it.  (Run, Edit, make current values default, Save, Post) along with what the data should look like combined.
0 Kudos
Message 5 of 5
(3,911 Views)