|
|
|
|
|
Calculating the Determinant
How to Examples Exercise How to: Determinants were briefly mentioned way back in Chapter 2. We learned how to compute the determinant of a 2x2 matrix. In Chapter 6, the book delves into many useful ways to help calculate the determinant of different sized square matrices, but in MATLAB, we need only memorize two simple commands: 1) For a regular matrix A: d = det(A) 2) For a symbolic matrix S: d = determ(S) These two commands will calculate the determinants of any size square matrix! But, it is still helpful to know how to do it on your own... Examples: A 4x4 matrix is a difficult calculation no matter which simplifying technique you use, but with MATLAB it's as easy as any other size matrix. Take the matrix A = [1 2 5 -1; 7 -3 7 4; 1 1 0 10; -1 -9 -9 0] To find its determinant we just input: d = det(A) And we quickly get back that d = 1010. Exercise: |