# Matrix of a system: syst2mat

### 5.56.1 Matrix of a system: syst2mat

The syst2mat command turns a system of linear equations into its augmented matrix. (For this command, the augmented matrix of Ax=b has the column vector −b glued to the right of A.)

- syst2mat takes two as arguments:
  - eqns, a list of the equations or expressions (assumed to be equal to zero) of a linear system.
  - vars, a list of the variable names.
- syst2mat(eqns,vars) returns the augmented matrix of the system.

Warning !!!
The variables must be purged before syst2mat is called.

#### Examples.

- Input:
  syst2mat([x+y,x-y-2],[x,y])
  Output:

  ⎛
  ⎜
  ⎝

  1 | 1 | 0
  1 | −1 | −2

  ⎞
  ⎟
  ⎠

- Input:
  syst2mat([x+y=0,x-y=2],[x,y])
  Output:

  ⎛
  ⎜
  ⎝

  1 | 1 | 0
  1 | −1 | −2

  ⎞
  ⎟
  ⎠