Home > @josh-brown/vector > MatrixBuilder > augment
Constructs a new matrix consisting of left and right next to one another. Throws an error of left and right do not have the same number of rows.
Signature:
augment(left: Matrix<S>, right: Matrix<S>): M;|
Parameter |
Type |
Description |
|---|---|---|
|
left |
Matrix<S> |
The matrix that will form the left-side of the augmented matrix |
|
right |
Matrix<S> |
The matrix that will form the right-side of the augmented matrix |
Returns:
M
The new augmented matrix
const left = matrixBuilder.ones(2);
const right = matrixBuilder.zeros(2, 3);
matrixBuilder.augment(left, right);
// [ 1 1 0 0 0 ]
// [ 1 1 0 0 0 ]