Previous Up Next

2.52.2  Gauss reduction of a matrix : ref

ref is used to solve a linear system of equations written in matrix form:


The argument of ref is the augmented matrix of the system (the matrix obtained by augmenting the matrix A to the right with the column vector B).
The result is a matrix [A1,B1] where A1 has zeros under its principal diagonal, and the solutions of:


are the same as the solutions of:


For example, solve the system :

3x + y=−2 
3x +2y=

Input :


Output :


Hence the solution is y=4 (last row) and x=−2 (substitute y in the first row).

Previous Up Next