Documente Academic
Documente Profesional
Documente Cultură
MaLrlces
MaLrlx Crdered seL of scalars arranged ln a recLangular paLLern
=
3 3 0
2 5 12
6 8 3
=
5 0
1 8
2 3
=
0
8
3
Scalars, Vectors & Matrices 4
W dd Lhe code shown Lo Lhe end of your
aLrlx_1 flle
W Save Lhe changes execuLe Lhe flle fro
Lhe oand Wlndow and verlfy Lhe
addlLlonal ouLpuL shown
W lndlvldual eleenLs of a aLrlx are
ldenLlfled by row and colun nubers
ln parenLhesls by Lhe aLrlx nae
W LleenLs of a aLrlx can be changed
lndlvldually
W Lxaple of a row vecLor
W Lxaple of a colun vecLor
Scalars, Vectors & Matrices 5
Scalar MulLlpllcaLlon
=
5 0
1 8
2 3
- -
- -
- -
= =
15 0
3 24
6 9
5 3 0 3
1 3 8 3
2 3 3 3
3
W ln Lhe scalar ulLlpllcaLlon of a
aLrlx each eleenL of Lhe aLrlx
ls ulLlplled by Lhe sae scalar
value
Scalars, Vectors & Matrices 6
MaLrlx ddlLlon or SubLracLlon
=
5 0
1 8
2 3
=
4 2
2 3
1 5
+
+ +
+ +
= + =
9 2
1 11
3 8
4 5 2 0
2 1 3 8
1 2 5 3
W or aLrlx addlLlon (or subLracLlon) Lhe
eleenLs of Lwo aLrlces are added (or
subLracLed) on eleenL by eleenL
basls
W 1he Lwo aLrlces usL be of equal order
le Lhey usL have Lhe sae nuber of
rows and coluns
W 1he resulL wlll be of Lhe sae order
Scalars, Vectors & Matrices 7
W Modlfy aLrlx_1 by addlng Lhe llnes
shown
W Save Lhe changes execuLe Lhe progra and
verlfy Lhe addlLlonal ouLpuL shown
W Scalar ulLlpllcaLlon of a aLrlx
W MaLrlx addlLlon
Scalars, Vectors & Matrices 8
MaLrlx MulLlpllcaLlon
=
5 0
1 8
2 3
=
4 2 1
2 3 5
- + - + - - + - + -
- + - + - - + - + -
= - =
4 5 2 ) 1 ( 1 2 4 0 2 8 1 3
) 2 ( 5 3 ) 1 ( 5 2 ) 2 ( 0 3 8 5 3
= - =
20 19
3 39
W or aLrlx ulLlpllcaLlon Lhe eleenLs ln Lhe
rows of Lhe flrsL aLrlx are ulLlplled by
eleenLs of Lhe coluns of Lhe second aLrlx
and Lhe producLs are added
W 1he aLrlces usL have opposlng order le
Lhe nuber of coluns of Lhe flrsL aLrlx
usL equal Lhe nuber of rows of Lhe second
aLrlx
W 8esulL ls a square aLrlx
Scalars, Vectors & Matrices 9
W Modlfy aLrlx_1 by addlng Lhe llnes
shown
W Save Lhe changes execuLe Lhe progra
and verlfy Lhe addlLlonal ouLpuL shown
W MaLrlx ulLlpllcaLlon of a 2x3 by a 3x3
resulLs ln a 2x3 aLrlx
W MaLrlx ulLlpllcaLlon of a 3x3 by a 2x3
ls lnvalld and resulLs ln an error essage
W MaLrlx ulLlpllcaLlon requlres aLrlces of
opposlng order
p x * x q p x q
Scalars, Vectors & Matrices 10
Speclal MaLrlces
=
1 4 5
1 6 3
4 8 2
1 1 4
4 6 8
5 3 2
%
=
1 1 4
4 6 8
5 3 2
1 0 0
0 1 0
0 0 1
+
+
=
1 0
0 1
9 / 1 3 9 / 2 3 9 / 1 4 9 / 2 2
6 / 1 3 6 / 1 3 6 / 1 4 6 / 1 2
1
=
1 4
6 8
3 2
9 / 1 9 / 2
6 / 1 6 / 1
1
|
,
|
=
)
`
|
,
|
=
=
=
)
`
|
,
|
=
=
)
`
|
,
|
=
2
1
9 / 1 2 9 / 2 8
6 / 1 2 6 / 1 8
2
8
9 / 1 9 / 2
6 / 1 6 / 1
=
)
`
|
,
|
+
+
=
)
`
|
,
|
=
)
`
|
,
|
=
2
8
3 2 4 1
3 2 2 1
2
1
3 4
3 2
2
1
W 9erfor a check by ulLlplylng Lhe
orlglnal coefflclenL aLrlx by Lhe soluLlon
vecLor
W 1he resulL should be equal Lo Lhe rlghL
hand slde vecLor fro Lhe equaLlon seL
Scalars, Vectors & Matrices 17
W Modlfy aLrlx_1 by addlng Lhe llnes
shown
W Save Lhe changes execuLe Lhe progra and
verlfy Lhe addlLlonal ouLpuL shown
W MaLlab lncludes a bullLln# funcLlon for
evaluaLlng Lhe lnverse of a aLrlx lnv()
W noLe LhaL ulLlplylng a aLrlx by lLs lnverse
resulLs ln Lhe ldenLlLy aLrlx
W alculaLe Lhe soluLlon for Lhe llnear equaLlon
seL by ulLlplylng Lhe rlghLhandslde vecLor
by Lhe lnverse of Lhe coefflclenL aLrlx