Basic Matrix Operations
-
Addition
Can only add a matrix with matching dimensions, or a scalar.
-
Scaling
-
Dot product of vectors
Inner product (dot product) x·y is also |x||y|Cos( the angle between x and y )
-
Multiplication
By convention, we can refer to the matrix product AA as A2, and AAA as A3, etc.
Obviously only square matrices can be multiplied that way -
Transpose
A useful identity: -
Inverse / pseudoinverse
Given a matrix A, its inverse A-1 is a matrix such that AA-1 = A-1A = I
E.g.
Inverse does not always exist. If A-1 exists, A is invertible or non-singular. Otherwise, it’s singular.
Useful identities, for matrices that are invertible:
Pseudoinverse
Say you have the matrix equation AX=B, where A and B are known, and you want to solve for X
You could use MATLAB to calculate the inverse and premultiply by it: A-1AX=A-1B → X=A-1B
MATLAB command would be inv(A)*B
But calculating the inverse for large matrices often brings problems with computer floating-point resolution (because it involves working with very small and very large numbers together).
Or, your matrix might not even have an inverse.
Fortunately, there are workarounds to solve AX=B in these situations. And MATLAB can do them!
Instead of taking an inverse, directly ask MATLAB to solve for X in AX=B, by typing A\B
MATLAB will try several appropriate numerical methods (including the pseudoinverse if the inverse doesn’t exist)
MATLAB will return the value of X which solves the equation:
If there is no exact solution, it will return the closest one
If there are many solutions, it will return the smallest one
MATLAB example:
-
Determinant / trace
det(A) returns a scalar
Represents area (or volume) of the parallelogram described by the vectors in the rows of the matrix
For
Properties:
Trace
Invariant to a lot of transformations, so it’s used sometimes in proofs. (Rarely in this class though.)
Properties:
2D Transformation

Homogeneous system
In general, a matrix multiplication lets us linearly combine components of a vector

-
This is sufficient for scale, rotate, skew transformations.
-
But notice, we can’t add a constant! :(
Hierarchy of 2D coordinate transformations.
-
translation
-
rigid(Euclidean) = rotation + translation
Note: R belongs to the category of normal matrices and satisfies many interesting properties:
-
similarity transform = scaled rotation
-
affine
Parallel lines remain parallel under affine transformations.
-
projection
Perspective transformations preserve straight lines
3D Transformation

网友评论