Skip to content

Augment Function

augment(...) returns an array formed by placing its arguments left to right. The arguments must be arrays with the same number of rows, or they must be scalars and row vectors.

For scalar values, augment() returns a row vector containing the list of arguments.

augment() with scalar arguments

In the next example, three row vectors, a, b, and c, are passed as arguments to augment().

augment() with row vector arguments

To obtain a matrix, the vectors must be in column form. Here, the three column vectors d, f, and g are passed as arguments to augment().

augment() with column vector arguments

Column vectors can easily be turned into rows in the matrix by applying a matrix transpose to augment().

augment() combined with a matrix transpose

See also

This page is based on a legacy wiki article by Edward Ulle.