Basic Examples (3)
Augment a matrix on the right with a list, one entry per row:
Display in matrix form to see the block structure:
Augment with a constant scalar:
Scope (3)
Use the operator form for pipeline composition:
MatrixAugmentRight works with non-numeric matrices:
The operator form composes naturally with itself, allowing successive augmentations within functional pipelines:
Applications (5)
Solving Linear Systems (1)
Use MatrixAugmentRight in operator form to construct the augmented matrix A|b, then apply RowReduce:
The unique solution x=(-1,3/2) is obtained from the last column of the reduced row echelon form.
Design Matrix with Intercept (1)
Use MatrixAugmentRight to construct homogeneous coordinates for affine transformations. Given a list of points {p1,…,pn} in ℝd, the embedding into projective coordinates ℝd+1 is a right augmentation with the constant scalar 1:
This is the canonical preprocessing step for the design matrix in least-squares regression with intercept. Each data row {xi,yi} is augmented with a constant 1 so that the intercept term is absorbed into the matrix–vector product X β.
Vandermonde-Like Matrices (1)
Use MatrixAugmentRight to construct Vandermonde-like matrices. Starting from a column of ones, each successive power of the abscissa vector is appended via the operator form combined with Fold:
This constructs a Vandermonde-like matrix by successive right-augmentation, appending increasing powers of the abscissa vector.
Matrix Bordering (1)
Use MatrixAugmentRight to construct matrices by successive right-augmentation of column blocks:
Each iteration appends a new column, illustrating matrix construction as an incremental bordering process.
Boundary Extension via Augmentation (1)
Use MatrixAugmentRight to extend a matrix by replicating its boundary values via right augmentation:
This appends the last column to the matrix, illustrating how augmentation can be used to construct simple boundary extensions.
Properties and Relations (5)
MatrixAugmentRight is equivalent to a block construction using ArrayFlatten with a threaded column vector:
MatrixAugmentRight is equivalent to a construction via outer transposition using Transpose and Append:
MatrixAugmentRight is equivalent to a row-wise construction using MapThread with Append:
MatrixAugmentRight can also be expressed using Join along the second level after promoting the vector to a one-column matrix:
ResourceFunction["AppendColumn"] can also be used for this task:
Unlike AppendColumn, MatrixAugmentRight also provides an operator form suited for compositional workflows.
Possible Issues (1)
A length mismatch between the matrix and the vector generates a dimension error:
Neat Examples (4)
Solve a parametric family of linear systems via augmentation and row reduction:
For each parameter value, the system is augmented and reduced, and the solution is read from the last column of the reduced row echelon form.
Append row indices to a dataset and sort by a column while retaining original row positions:
This attaches a unique index to each row, allowing sorting operations while retaining a reference to the original ordering.
Construct a Cayley table by augmenting a group multiplication table with its row labels:
This constructs the Cayley table of a finite group and appends the corresponding group elements as row labels using right-augmentation.
Use MatrixAugmentRight together with rotations to construct boundary extensions of a matrix. Each side is obtained by directional augmentation, enabling consistent neighborhood structure without explicit padding functions:
This constructs a boundary-extended matrix by applying directional augmentations. Each boundary is generated by rotating the matrix and reusing right-augmentation, yielding a full extension that preserves local structure.