
Matlab’s command:
>> clear; U=[-1 2 1; 0 -2 3]; V=[1:3; 5 2 4];
>> U.^2, U.*V, (1./V).^2.*U, U.^U
Matlab’s response:
ans =
1 4 1
0 4 9
ans =
-1 4 3
0 -4 12
ans =
-1.0000 0.5000 0.1111
0 -0.5000 0.1875
ans =
-1.0000 4.0000 1.0000
1.0000 0.2500 27.0000
Comments:
Dot operations with two-dimensional arrays.
2.1.4.2 Matrix to Vector Product – Matrix to Matrix Product
A matrix can be multiplied with a vector or a matrix as long as the following
rule concerning their dimensionality/sizes holds:
)ln()nm(
That is, the first’s matrix columns equal the second’s rows. A matrix “A”
with dimensions
can be multiplied with a matrix “B” with dimensions
lm
resulting to a matrix “C” with dimensions lm
:
lmnmlm
BAC
×××
×=
The above matrix “A” can be multiplied with a m
1 row vector “R1” from
left to produce a n
1 row vector “R” while “A” can be multiplied with an
1
n column vector “C1” to the right to produce a column vector “C” with
1
m dimensions:
nmmn
ARR
×××
×=
11
1
Komentáře k této Příručce