Mat Assignment (Matrix Multiplication) - IBM 5100 Basic Reference Manual

Hide thumbs Also See for 5100:
Table of Contents

Advertisement

120
MAT matrix-name [(rows ,columns) ]
=
matrix-name
*
matrix-name
MAT ASSIGNMENT (MATRIX MULTIPLICATION)
This statement allows you to perform the mathematical matrix multiplication of two
numeric matrices and assign the product to a third matrix. The syntax of this state-
ment is as shown:
MAT matrix-name [(rows ,columns)]
=
matrix-name
*
matrix-name
where:
all parameters in the statement are the same as those for other MAT assignment
statements.
In matrix multiplication, a matrix (A) of dimensions (p,m) and a matrix (B) of dim-
ensions (m,n) yield a product matrix (C) of dimensions (p,n) such that for i
=
1,2, ... ,p
and for
j
=
1,2 ... ,n:
m
CO,j) =
L
k=1
AO,k)* B(k,j)
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 redi-
mension the matrix before values are assigned to it.
Notes About MAT (Matrix Multiplication)
• All three matrices specified must be numeric.
• If the matrix specified to the left of the equal sign is the same as either matrix
to the right of the equal sign, you will get incorrect results.
• All of the following relationships must be true (after redimensioning, if any) where:
A= B*C
1.
All three matrices must be two-dimensional.
2.
The number of columns in the second matrix (B) mustbe equal to the
number of rows in the third matrix (C).
3.
The number of rows in the first matrix (product matrix A) must equal the
number of rows in the second matrix (B).
4.
The number of columns in the first (product matrix A) must equal the
number of columns in the third matrix (C).
• If redimension specifications are included, the rules described under Redimen-
sioning Arrays, Chapter 3, must be followed.

Advertisement

Table of Contents
loading

Table of Contents