Previous Up Next

5.49.21  Add k times a row to an another row : mRowAdd, scaleadd, SCALEADD

mRowAdd takes four arguments : a real k, a matrix A and two integers n1 and n2.
mRowAdd returns the matrix obtained by replacing in A, the row of index n2 by the sum of the row of index n2 and k times the row of index n1.
Input :

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

Output :

[[5,7],[3,4],[4.3,6.4]]

The scaleadd (or SCALEADD) command is the same as mRowAdd, except that it takes the arguments in a different order; the matrix comes first, then the real number, then the two integers.
Input:

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

Output:

[[5,7],[3,4],[4.3,6.4]]

Previous Up Next