Previous Up Next

14.3.11  Elementary row operations

Adding a row to another row.

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

Example

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


12
46


          
Multiplying a row by an expression.

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

The scale or SCALE command is similar to mRow except for a different order of arguments.

Examples

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


12
3648


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


12
3648


          
Adding k times a row to another row.

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

The scaleadd or SCALEADD command is similar mRowAdd except for a different order of arguments.

Examples

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



57
34
4.36.4



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



57
34
4.36.4



          
Exchanging two rows.

The rowSwap or rowswap or swaprow command switches two rows in a matrix.

Example

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


34
12


          
Exchanging two columns.

The colSwap or colswap or swapcol command switches two columns in a matrix.

Example

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


21
43


          

Previous Up Next