Matrices MM1 module 3, lecture 1
Aug 20, 2015
Slide number 2
Matrices lesson 1 objectives
• After this lesson you should have a clear understanding of:• What matrices are;• Performing basic operations on matrices;• Special forms of matrices
Slide number 3
What is a matrix?
• A matrix is a rectangular array of elements
• The elements may be of any type (e.g. integer, real, complex, logical, or even other matrices).
• In this course we will only consider matrices that have integer or real number values.
5 0 1 23 4 9 23 1 4 2
Slide number 4
Order of matrices…
• Order 4 3:
• Order 3 4:
3 columns
4 rows
5 0 1
2 3 4
9 2 6
3 1 4
4 columns
3 rows
5 0 1 2
3 4 9 2
3 1 4 2
Slide number 5
…Order of matrices
• Order 2 4:
• Order 1 6:
• Order 3 1:
1 columns
3 rows
3
1
5
6 columns1 rows
2 1 1 2 1 5
4 columns2 rows
23 0.5 4.3 12
8 2 8 1
Slide number 6
Specifying matrix elements
• aij denotes the element of the matrix A on the ith row and jth column.
A
column j
row i
5 0 12 3 4 9 2 63 1 4
• a12 = 0
• a21 = 2
• a23 = -4
• a32 = 2
• a41 = 3
• a43 = 4
Slide number 7
Matrix operations: scalar multiplication
• Multiplying an m n matrix by a scalar results in an m n matrix with each of its elements multiplied by the scalar.
• e.g.
826
12418
864
2010
413
629
432
105
2
1239
18627
1296
3015
413
629
432
105
3
Slide number 8
Matrix operations: addition…
• Adding or subtracting an m n matrix by an m n matrix results in an m n matrix with each of its elements added or subtracted.
• e.g.
431
8112
113
136
024
213
541
231
413
629
432
105
417
436
971
334
024
213
541
231
413
629
432
105
Slide number 9
…Matrix operations: addition
• Note that matrices being added or subtracted must be of the same order.
• e.g.
invalid! 113
201
413
629
432
105
Slide number 10
Special matrices: row and column
• A 1 n matrix is called a row matrix.e.g.
• An m 1 matrix is called a column matrix.e.g.
1 columns
3 rows
3
1
5
6 columns1 rows
2 1 1 2 1 5
Slide number 11
Special matrices: square
• An n n matrix is called a square matrix.i.e. a square matrix has the same number of rows and columns.e.g.
4705
7350
0523
5031
211
010
210
21
321
Slide number 12
Special matrices: distance
• A distance matrix is a square matrix that shows the distances between locations. Distance matrices are frequently used on road maps to show the number of kilometres between major cities. Note that the main diagonal elements are all zeros.