Octave for Chapter 7

Examples in this section provide sample Octave code for finding determinants and illustrating their uses and properties. You can access our code through the link at the bottom of each template. Feel free to modify the code and experiment to learn more!

You can write your own code using Octave software or online Octave cells. To access Octave cells online, go to the Sage Math Cell Webpage, select OCTAVE as the language, enter your code, and press EVALUATE.

To ”save” or share your online code, click on the Share button, select Permalink, then copy the address directly from the browser window. You can store this link to access your work later or share this link with others. You will need to get a new Permalink every time you modify the code.

Octave Tutorial

We will use the det function to find determinants in Octave.

The following example illustrates a common technique for computing determinants numerically.

Unfortunately, -factorization is prone to round-off error, which may lead to erroneous or ambiguous outcomes, as you will see Problem prob_oct_det1.

Recall the following properties of determinants.

For our next example, recall the following theorem, known as Cramer’s Rule.

Octave Exercises

Let

Determine whether each of the above matrices is singular in two different ways.

  • Use the det function
  • Use an alternative approach

Are the two methods used above in agreement? Click the arrow on the right to learn more.

Octave uses -decomposition to compute the determinant. This method is susceptible to rounding errors (Reference). Because of this, using the det function to determine singularity is generally not a good idea.

If is non-singular, find , and . Illustrate the relationship between and computationally.

Modify Example ex_det_prop to illustrate parts (a) and (c) of Theorem th:elemrowopsanddet. (Use rows and coefficients of your choice.)
Modify the code of Example ex_oct_det_cramer to find and .
2024-09-28 13:32:33