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
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
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’;
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 =
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 = Note: d = a - 1 means d(i,j) = a(i,j) - 1
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 = c = 3
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