From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Concatenate 2d arrays

Hi,

 

Kind of a noob here. So here is what I want:

 

All 2d arrays -

 

Array 1: Array2: Appended Array:

 

0,1,2 6,7,8 0,1,2,6,7,8

3,4,5 9,10,11 3,4,5,9,10,11

 

So I know I can do this by indexing both input arrays and then appending them and then build another 2d array. My question is, is there a way to do this that is nice and neat and not so convoluted?

 

Thanks for any help. 

0 Kudos
Message 1 of 15
(14,612 Views)

Duplicate post.

 

Please do not ask the same question twice. Have a little patience.

 

 

EDIT:  It appears this may have been an automatically created thread due to it being moved from the LabVIEW Idea Exchange where it was originally posted. In that case, please disregard my comment regarding the chiding on the patience. It's still wise to have a little patience in general, though. Smiley Very Happy

Message Edited by smercurio_fc on 12-11-2009 09:27 AM
Message 2 of 15
(14,542 Views)

Cant you just use Build array but r-click it for concatenate inputs?

Else you can use Insert into array and add after the last column i s'pose.

Or you can transpose both matrices and build array and transpose back ...

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 3 of 15
(14,522 Views)

Yamaeda wrote:

Cant you just use Build array but r-click it for concatenate inputs?

Else you can use Insert into array and add after the last column i s'pose.

Or you can transpose both matrices and build array and transpose back ...

 

/Y


If you check out the other thread you'll see the solutions posted. Smiley Wink

0 Kudos
Message 4 of 15
(14,503 Views)

I also have a question. Concatenating 1D arrays works fine

1,2,3,4  concatenated with 5,6,7,8,9 gives 1,2,3,4,5,6,7,8,9

but with 2D arrays

1,2,3,4

5,6,7,8 

concatenated with

10,11,12

20,21,22

gives

1,2,3,4

5,6,7,8

10,11,12,0

20,21,22,0

Why not

1,2,3,4,10,11,12

5,6,7,8,20,21,22  ?

 

0 Kudos
Message 5 of 15
(13,451 Views)

Attach your code.

 

There are several ways to concatenate, maybe you want to transpose first, for example, or wrap a FOR loop around it.

0 Kudos
Message 6 of 15
(13,440 Views)

Transpose before and after concatenating.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 15
(13,427 Views)

Fun with transposing arrays.  Can't count how many times I've had to do this for table displays...


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 8 of 15
(13,424 Views)

altenbach wrote:

There are several ways to concatenate, maybe you want to transpose first, for example, or wrap a FOR loop around it.


Here's the second method I suggested, same difference: 😄

 

 

This seems cleaner, but I am not sure what's more efficient....

0 Kudos
Message 9 of 15
(13,405 Views)

Some people might try to suggest that you can do more with less code.....

 

BuildMatrix.png

 

BuildMatrixFP.png

Message 10 of 15
(13,393 Views)