Matrices ------------------------------------------------------------------------------- Matrix definition: + same structure and look as an array + usually means rectangular or square, but could have more dimensions + a matrix is an array that represents a linear transformation Notation for linear transformation: Ax = b A: coefficient matrix x: solution vector b: source vector Example: 2x-2y = 10 \ [ 2 -2] {x} = {10} >-> [-2 5] {y} {20} -2x+5y = 20 / A x b What does all this mean? + So, matrix A transforms x into b + To find x, you need to solve the set of simultaneous equations + see "Solving Systems of Equations" in Mathematics Resources online + in MATLAB, try this: >> A=[2 -2;-2 5]; b=[10 20]'; x=A\b (see also $solve$) Arithmetic Operations (copied from MATLAB HELP): + Plus. X + Y adds matrices X and Y. X and Y must have the same dimensions unless one is a scalar (a 1-by-1 matrix). A scalar can be added to anything. - Minus. X - Y subtracts matrix X from Y. X and Y must have the same dimensions unless one is a scalar. A scalar can be subtracted from anything. * Matrix multiplication. X*Y is the matrix product of X and Y. Any scalar (a 1-by-1 matrix) may multiply anything. Otherwise, the number of columns of X must equal the number of rows of Y. ^ Matrix power. Z = X^y is X to the y power if y is a scalar and X is square. If y is an integer greater than one, the power is computed by repeated multiplication. For other values of y the calculation involves eigenvalues and eigenvectors. Z = x^Y is x to the Y power, if Y is a square matrix and x is a scalar, computed using eigenvalues and eigenvectors. Z = X^Y, where both X and Y are matrices, is an error. -------------------------------------------------------------------------------