Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
5 ratings:
 3.60 out of 5   

How Does Concatenate Arrays Work in LabVIEW for Higher Dimensional Arrays?

Primary Software: LabVIEW Development Systems>>LabVIEW Base Development System
Primary Software Version: 7.0
Primary Software Fixed Version: N/A
Secondary Software: N/A

When I concatenate two 1D arrays using the Build Array function, as shown below, LabVIEW creates a new 1D array whose size is the sum of the sizes of the input arrays. However, if the input arrays are 2D, there are two possible ways of concatenating the arrays. Which one does LabVIEW choose? For example, if I concatenate two arrays of X rows and Y columns, will the resultant array have 2X rows and Y columns or X rows and 2Y columns? What about for even higher dimensions like 3D, 4D etc.?


LabVIEW always chooses the highest dimension to concatenate. For example, when concatenating 2D arrays, LabVIEW always concatenates the rows. So, in our previous question, we will get an array that has 2X rows and Y columns, as shown below. For 3D arrays, which contain pages, rows and columns, the resultant array will contain pages equal to the sum of the number of pages in the two input arrays. Similarly, a 4D array contains volumes, pages, rows and columns. LabVIEW concatenates two 4D arrays by their volumes.

If there is a discrepancy in the size of the non-concatenated dimensions of the input arrays, LabVIEW uses the maximum value as the size of the dimension. For example, array A has X pages, Y rows and Z columns, and array B has K pages, L rows and M columns. Concatenating the two arrays will result in an array that has X+K pages, max(Y, L) rows, and max(Z, M) columns.

Related Links:
KnowledgeBase 4CGDJ61S: How to Concatenate Multiple Arrays in LabVIEW
KnowledgeBase 1F1FC5G7: How Can I Combine Two Arrays from the Front Panel?


Report Date: 01/05/2005
Last Updated: 07/05/2017
Document ID: 3H46QV5L

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit