- (Matrix)

Returns the difference of two matrixes with the same dimension.

Arguments

matrix0
is the Matrix to subtract from.
matrix1
is the Matrix to subtract.
They must have the same dimension, otherwise, an error will occur.

Return values

matrix2
is the subtraction result Matrix.

Complexity

O(dimension)

Example

"sl/algebra" useFile m1: ((1.0 3.0 2.0) (1.0 2.0 -3.0) (4.0 -6.0 6.0)) makeMatrix; m2: ((6.0 -3.0 1.0) (-1.0 1.0 8.0) (0.0 2.0 -8.0)) makeMatrix; m: m1 m2 -; m.rows [i m.rowRange [print "," print] each LF print] times
Output:
-5.000000,6.000000,1.000000, 2.000000,1.000000,-11.000000, 4.000000,-8.000000,14.000000,