LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

appending two 2-D arrays of unequal dimentions

Solved!
Go to solution

Greetings Everyone,

                              Once again I have a very basic questions. I am trying to append two 2-D arrays with different row size. the 'build array' function creates a 3-D array. I am using the reshape array function to convert the 3-D array to a 2 D array. It works great if I have two same sized array, however if the rowsize of the first 2-D array is smaller than that of second, it adds up additional row of zeroes in between. I can understand why it does that, but I don't know how I could avoid that. is there any other efficient way if appending arrays without creating a 3-D array?

Attached is the example that I have been working on. 

Thanks!



------------------------------------------------------------------------------------------------------
Kudos are (always) welcome for the good post. 🙂
0 Kudos
Message 1 of 4
(2,571 Views)

Arrays, by definition, have all rows of equal length, all columns of equal length, all pages have equal numbers of rows and columns, and so on for higher dimensions.

 

If you really need arrays of arrays of different sizes, you can put the 2D array inside a cluster and then make a 1D array of clusters.  The 2D arrays inside the clusters can have different sizes.

 

Lynn

 

 

Message 2 of 4
(2,566 Views)
Solution
Accepted by topic author odessy27

odessy27 wrote:
the 'build array' function creates a 3-D array

Right Click that Build Array function and select 'Concatenate Inputs' and you will get a 2D array out.

Message 3 of 4
(2,556 Views)

@Darin.K wrote:

odessy27 wrote:
the 'build array' function creates a 3-D array

Right Click that Build Array function and select 'Concatenate Inputs' and you will get a 2D array out.


I thought about doing that and I don't know why I never tried it. It works just great! I guess I still don't understand the array functions as much as I thought I did. Smiley Happy Thank you guys!

 



------------------------------------------------------------------------------------------------------
Kudos are (always) welcome for the good post. 🙂
0 Kudos
Message 4 of 4
(2,550 Views)