﻿ aug – Algosim documentation
Algosim documentation: aug

# aug

Returns a matrix with a new column added.

## Syntax

• `aug(A, v)`

• `A` is a matrix

• `v` is a vector

• `aug(A, B)`

• `A` is a matrix

• `B` is a matrix

## Description

If `A` is a matrix of size `m`×`n` and `v` an `m`-dimensional vector, then `aug(A, v)` returns the matrix obtained from `A` by appending `v` to it as a new rightmost column.

More generally, if `A` and `B` are matrices with the same number of rows, then `aug(A, B)` returns the matrix obtained by putting them next to each other, with `A` to the left and `B` to the right.

If `A` or `B` above is not a matrix but a vector, it is treated like a single-column matrix. If `A`, `B`, or `v` is a number, it is treated like a single-entry matrix.

## Examples

`aug(IdentityMatrix(3), ZeroVector(3))`
```⎛1  0  0  0⎞
⎜0  1  0  0⎟
⎝0  0  1  0⎠
```
`3⋅aug(IdentityMatrix(3), HilbertMatrix(3))`
```⎛   3     0     0     3   1.5     1⎞
⎜   0     3     0   1.5     1  0.75⎟
⎝   0     0     3     1  0.75   0.6⎠
```