Table Of Contents

Insert into Array (G Dataflow)

    Last Modified: March 15, 2017

    Inserts an element or subarray into an array at the index you specify.



    The array in which you want to insert an element, row, column, page, and so on. This input is an n-dimension array of any type.



    The location in the array where you want to insert the element, row, column, page, and so on. This node automatically provides an index input for each dimension of the array. You can wire only one index input.

    If index is larger than the array size, the node does not insert anything into the input array.

    Relationship between index Inputs and array Dimensions

    For multidimensional arrays, index inputs correspond to row-major order. Thus, the first index corresponds last dimension of the array input, and the last index corresponds to the first dimension of the array input. The following table shows the relationship between four index inputs and the dimensions of a 4D array input.

    index Order Corresponding Dimension in array Input index Name
    1 4th volume index
    2 3rd page index
    3 2nd row index
    4 1st column index

    Default: new element or subarray appends to the end of array.


    new element or subarray

    The element or array that inserts into an element, row, column, or page in the array specified in array.

    The data type of the new element or subarray must be the same type as the input array.

    Data Type Changes on FPGA

    When you add this node to a document targeted to an FPGA, this input has a default data type that uses fewer hardware resources at compile time.


    output array

    The array with the inserted element(s).

    Resizing Behavior Based on an Index Input

    This node resizes the array along one dimension. Therefore, you can wire only one index input. The index you wire determines the dimension into which you can insert new element or subarray. For example, to insert rows, wire the row index, or to insert columns, wire the column index.

    Requirements for new element or subarray Dimension

    The array you wire to new element or subarray must be the same dimension or a dimension less than the one you wire to array. For example, you cannot insert a single element into a 2D array, and you cannot insert a 1D array into a 3D array

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: This product does not support FPGA devices

    Recently Viewed Topics