Presentation is loading. Please wait.

Presentation is loading. Please wait.

S. Awad, Ph.D. M. Corless, M.S.E.E. E.C.E. Department University of Michigan-Dearborn Matlab Basics Introduction to Matlab: Matrix Operations.

Similar presentations


Presentation on theme: "S. Awad, Ph.D. M. Corless, M.S.E.E. E.C.E. Department University of Michigan-Dearborn Matlab Basics Introduction to Matlab: Matrix Operations."— Presentation transcript:

1

2 S. Awad, Ph.D. M. Corless, M.S.E.E. E.C.E. Department University of Michigan-Dearborn Matlab Basics Introduction to Matlab: Matrix Operations

3 MATLAB Basics: » U of M-Dearborn ECE Department Introduction to MATLAB and its Toolboxes Matrix Operations 2 n Transpose Transpose n Addition Addition n Subtraction Subtraction n Multiplication Multiplication n Matrix Powers Matrix Powers

4 MATLAB Basics: » U of M-Dearborn ECE Department Introduction to MATLAB and its Toolboxes Matrix Operations 3 Transpose of a Matrix » a = [ 1 2 3; 4 5 6; 7 8 9]; » b = a’;

5 MATLAB Basics: » U of M-Dearborn ECE Department Introduction to MATLAB and its Toolboxes Matrix Operations 4 n Matrices a, b, & c will have same dimensions n For addition c(i,j) = a(i,j) + b(i,j) Note: c = a + 1 means c(i,j) = a(i,j) + 1 Addition of Matrices » c = a + b c = 2 6 10 6 10 14 10 14 18

6 MATLAB Basics: » U of M-Dearborn ECE Department Introduction to MATLAB and its Toolboxes Matrix Operations 5 Subtraction of Matrices n Matrices a, b, & d will have same dimensions n For subtraction d(i,j) = a(i,j) - b(i,j) » d = a - b d = 0 -2 -4 2 0 -2 4 2 0 Note: d = a - 1 means d(i,j) = a(i,j) - 1

7 MATLAB Basics: » U of M-Dearborn ECE Department Introduction to MATLAB and its Toolboxes Matrix Operations 6 Multiplication of Matrices Suppose: a is n x m (n by m) & b is m x for c = a * b, c must be n x  » a = [ 1 1 1]; » c = a * a’;% c = 1 + 1 + 1 c = 3

8 MATLAB Basics: » U of M-Dearborn ECE Department Introduction to MATLAB and its Toolboxes Matrix Operations 7 n Assume that a is a square matrix, then  b = a^2 means b = a* a  c = a^5 means a*a*a*a*a n In general  d = a^p = a*a*a*...*a (for p times) n In case p is not an integer (i.e. p = 1/2)  e = a^0.5 means a = e*e Note: a^-1  inv(a) Matrix Powers


Download ppt "S. Awad, Ph.D. M. Corless, M.S.E.E. E.C.E. Department University of Michigan-Dearborn Matlab Basics Introduction to Matlab: Matrix Operations."

Similar presentations


Ads by Google