Environmental Engineering Reference
In-Depth Information
in the i- th row and j -th column of A + B, the elements in the i-th row and j-th
column of A and B have to be added:
ð
A
þ
B
Þ ij ¼ a ij þ b ij
(1.4)
Example in MATLAB
:
®
When the number of columns or the number of lines do not coincide,
MATLAB
produces an error:
®
Clearly the subtraction of matrices is defined analogously. One may also for-
mally introduce subtraction by the definition that subtraction of B is the addition of
-B. As one may expect -B contains the negative of the elements of B and is the
inverse of B with respect to the addition operation. The generalizations of matrix
multiplication and division are slightly more complex.
It was already mentioned that there are several multiplication operations. Corre-
spondingly there are several division operations. Aside from scalar multiplication,
there are several matrix multiplications. The standard matrix multiplication for the
two matrices A and B, given by
0
@
1
A
0
@
1
A
a 11
a 12
:::
a 1 k
b 11
b 12
:::
b 1 m
a 21
a 22
:::
a 2 k
b 21
b 22
:::
b 2 m
A
¼
and B
¼
(1.5)
:::
:::
:::
:::
:::
:::
:::
:::
a n 1
a n 2
:::
a nk
b k 1
b k 2
:::
b km
in order to obtain a new matrix A
B, is defined by the following formula:
X
k
ð
A
B
Þ ij ¼
a ik b kj
(1.6)
1
This is a formula for the element in the i -th row and j -th column of the matrix AB.
Matrices can be multiplied if the first matrix has the same number of columns as the
second matrix has columns (inner dimension). In formula ( 1.6 ) that number is k .
Elements in lines of the first matrix are multiplied with columns of the second matrix,
and the products are summed in order to obtain an entry in the result matrix A
B.
Search WWH ::




Custom Search