118
MAT matrix-name
[(rows
[,columns]
I]
=
matrix-name{
+
}matrix-name
MAT
ASSIGNMENT (ADDITION
AND
SUBTRACTION)
The
MAT
assignment statement allows you
to
add or subtract the contents
of
two
matrices and assign
the
result
to
a third matrix. The syntax of the statement
is
as
shown:
MAT matrix-name
[(rows
l.columns]
I]
=
matrix-name{
+
}matrix-name
where:
all
parameters of the statement are the same
as
those for other
MAT
assignment
statements.
The corresponding elements of the matrices specified
to
the right
of
the equal sign
are added
or
subtracted,
as
indicated, and the result of the operation
is
assigned
to
the corresponding elements
in
the
mat~ix
specified
to
the left
of
the equal sign.
If
redimension specifications follow the matrix name
to
the left
of
the equal sign,
the truncated integer portion
of
each expression value
in
rows, columns
is
used
to
redimension the matrix before values are assigned
to
it.
Notes About
MAT
(Addition and Subtraction)
•
All
three matrices must
be
numeric.
•
All
three matrices specified
in
the statement must have identical dimensions
(after redimensioning,
if
any).
•
If
redimension specifications are included, the rules described under Redimen-
sioning Arrays,
Chapter 3, must
be
followed.