Previous Up Next

6.45.11  The elementary row operations

Adding a row to another row: rowAdd

The rowAdd command adds one row of a matrix to another row.


Example.
Input:

rowAdd([[1,2],[3,4]],0,1)

Output:



12
46


Multiplying a row by an expression: mRow scale SCALE

The mRow, scale and SCALE commands multiply a row of a matrix by an expression.


Example.
Input:

mRow(12,[[1,2],[3,4]],1)

Output:



12
3648



The scale command is the same as mRow except that it takes the arguments in a different order.
SCALE is a synonym for scale.


Example.
Input:

scale([[1,2],[3,4]],12,1)

Output:



12
3648


Adding k times a row to an another row: mRowAdd scaleadd SCALEADD

The mRowAdd, scaleadd and SCALEADD commands add a multiple of one row of a matrix to another.


Example.
Input:

mRowAdd(1.1,[[5,7],[3,4],[1,2]],1,2)

Output:




57
34
4.36.4



The scaleadd command is the same as mRowAdd except that it takes the arguments in a different order.
SCALEADD is a synonym for scaleadd.


Example.
Input:

scaleadd([[5,7],[3,4],[1,2]],1.1,1,2)

Output:




57
34
4.36.4



Exchanging two rows: rowSwap rowswap swaprow

The rowSwap command switches two rows in a matrix.
rowswap and swaprow are synonyms for rowSwap.


Example.
Input:

rowSwap([[1,2],[3,4]],0,1)

Output:



34
12


Exchanging two columns: colSwap colswap swapcol

The colSwap command switches two columns in a matrix.
colswap and swapcol are synonyms for colSwap.


Example.
Input:

colSwap([[1,2],[3,4]],0,1)

Output:



21
43



Previous Up Next