NAME

laminate - concatenate two arrays about an alternate axis

SYNOPSIS

res = arr0.laminate(arr1[, axis])

DESCRIPTION

Concatenates arr0 and arr1 along a new or existing axis. This is similar to APL arr0 , arr1 and arr0 ,[axis] arr1.

If axis is not an integer (e.g., 0.5, -1.5), it "laminates" the two arrays by creating a new axis at that position. The two arrays must have the same shape for the dimensions being laminated if a new axis is created. The position of the new axis is Int(axis + 1.0) if axis is positive, or Int(axis) if axis is negative.

If axis is an integer, it behaves like concat, but with more flexible shape handling, such as promoting scalars to arrays to match the other argument.

If axis is omitted, it defaults to the last dimension (-1).

RETURN VALUE

Returns the combined array.

ERRORS

ArgCheck: Thrown if the number of arguments is not 2 or 3.
RangeCheck: Thrown if axis is out of bounds for the rank of the arrays.
ShapeCheck: Thrown if the shapes of arr0 and arr1 are incompatible for the specified axis.
TypeCheck: Thrown if the elements of arr0 and arr1 cannot be promoted to a common type.

EXAMPLE

    a = [1, 2, 3]
    b = [4, 5, 6]
    a.laminate(b, -0.5)
1 2 3
4 5 6

    a.laminate(b, 0)
1 2 3 4 5 6

SEE ALSO

concat
reshape
shape