Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 11 Matrices and Linear Algebra with MATLAB

Similar presentations


Presentation on theme: "Lecture 11 Matrices and Linear Algebra with MATLAB"— Presentation transcript:

1 Lecture 11 Matrices and Linear Algebra with MATLAB
Dr .Qi Ying

2 Objectives Review Matrix Operations Review Linear Algebra
Linear systems of equations Matrix operations Solve linear systems of equations in MATLAB

3 Matrix Notation Principle diagonal

4 Matrix Notation Row vector and column vector

5 Matrix Terminology Diagonal matrix: square matrix where all elements off the main diagonal are zero Identity matrix: diagonal matrix where all elements on the main diagonal are equal to 1

6 Matrix Terminology Upper/lower triangular matrix

7 Matrix Terminology Banded matrix Tridiagonal matrix: Band width = 3

8 Matrix Operation Transpose: exchange rows for columns

9 Matrix Terminology Symmetric matrix: aij=aji or AT=A

10 Matrix Operation Addition/subtraction Must be of the same size
Perform operation element by element

11 Matrix Operation Multiplication with a scalar
The scalar is multiplied with each element to form a new matrix

12 Matrix Operation Multiplication with matrix
Number of columns in the first matrix must equal to the number of rows in the second matrix row1 Column 2

13 Matrix Operation In general, matrix multiplication is NOT commutative:
For square matrix:

14 Matrix Operation Matrix inversion: for square matrix
B is defined as the inverse of matrix A, or [B]=[A]-1

15 Matrix Operation Matrix inversion for 2x2 matrix

16 Linear systems of equations

17 Linear systems of equations
Solution of linear systems using MATLAB >> A=[5 3 2; 4 3 7; 7 5 1]; >> b=[7 9 5]'; >> x=inv(A)*b x = 3.1852 1.0370

18 Linear systems of equations
Check the results: >> x=A\b x = 3.1852 1.0370 >> A*x ans = 7.0000 9.0000 5.0000

19 Matrix Operation Matrix augmentation: adding one or more columns to the original matrix. Useful when we want to apply identical row operations on two matrices.


Download ppt "Lecture 11 Matrices and Linear Algebra with MATLAB"

Similar presentations


Ads by Google