LabVIEW

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

Concatenate 2d arrays

Highlighted

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
(6,751 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
(6,681 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! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
Message 3 of 15
(6,661 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
(6,642 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
(5,590 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.


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 6 of 15
(5,579 Views)

Transpose before and after concatenating.

/Y

G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 15
(5,566 Views)

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


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 8 of 15
(5,563 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: Smiley Very Happy

 

 

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


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 9 of 15
(5,544 Views)

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

 

BuildMatrix.png

 

BuildMatrixFP.png

Message 10 of 15
(5,532 Views)