
A2 =
1.0000 1.7500 2.5000 3.2500 4.0000
1.0000 2.0000 3.0000 4.0000 5.0000
1.0000 1.7500 2.5000 3.2500 4.0000
1.0000 2.0000 3.0000 4.0000 5.0000
A3 =
1.0000 1.7500 2.5000 3.2500 4.0000 -9.0000 -5.0000
-4.0000 -3.0000 -2.0000 -1.0000 NaN Inf 1.0000
Comments:
Various manipulations with matrices.
The examples above, illustrate the case where a larger matrix can be created
from smaller ones. Also, pay attention that Matlab returns an error if the
user tries to combine row or column vectors with different lengths to create
a two dimensional array.
Usually, it is imperative need to store the size of a matrix in some variables.
This can be done via a build in function named as
s
s
i
i
z
z
e
e:
Matlab’s command:
>> [m1 n1]=size(A1); [m2 n2]=size(A2); [m3 n3]=size(A3);
>> M_N=[m1 n1; m2 n2; m3 n3]
Matlab’s response:
M_N =
2 5
4 5
2 7
Comments:
Using the
s
s
i
i
z
z
e
e function to find the size of various matrices. Each
row of the
M
M
_
_
N
N matrix contains the size of matrices
A
A
1
1,
A
A
2
2 and
A
A
3
3 respectively.
2.2.1 Transpose of a Matrix
Recall matrix “A” that was defined earlier. The transpose of “A”, symbolized
in linear algebra as “A
T
” is the following:
=
×
24232221
14131211
42
aaaa
aaaa
A ,
=
×
2414
2313
2212
2111
24
aa
aa
aa
aa
A
T
Kommentare zu diesen Handbüchern