
2.2.2 Matrix Basic Manipulations
Subtraction and multiplication with a scalar are similar as with the vector
case. Matrix dimensions (
s
s
i
i
z
z
e
e) must match when performing manipulations
with addition and subtraction. Some examples follow:
Matlab’s command:
>> J=[-1 2 3 1; 5 2 4 2; 1 1 2 0]; I=[1 4 5 2; 8 7 5 1; -1 1 -1 1];
>> J+2*I, J(:,1)+I(:,2), J(1,:)-1/4*I(2,:)
Matlab’s response:
ans =
1 10 13 5
21 16 14 4
-1 3 0 2
ans =
3
12
2
ans =
-3.0000 0.2500 1.7500 0.7500
Comments:
Basic matrix addition, subtraction and scalar multiplication.
2.1.4 Matrix Manipulations Related to Products, Division, and
Powers
Similar rules as with the case of vectors apply to matrix manipulations
related with dot operations and products of matrices.
2.1.4.1 Matrix Dot Product, Division and Powers
It is straightforward to generalize the properties of dot operations from the
case of vectors to the case of two-dimensional arrays. The operations are
again performed element-by-element. Work on the following examples to
learn the use of dot operations with matrices (remember which operations
come first).
Comentarios a estos manuales