Time for action – doing left and right division

  1. We need to instantiate the coefficient matrix A and vector y first:
    octave:93> A=[2 1 -3; 4 -2 -2; -1 0.5 -0.5]; y = [1; 3; 1.5];
    
  2. The solution to the linear equation system, Equation (2.6), is then found directly via the command:
    octave:94> A\y
    
    ans =
        -1.6250
        -2.5000
        -2.2500
    

    Easy!

What just happened?

It should be clear what happened. In Command 93, we instantiated the matrix A and the vector y that define the linear equation system in Equation (2.6). We then solve this system using the left division operator. Later in Chapter 6, we will investigate how the left division operator performs for very large systems.

Let us try the right division operator, even though we know that it will cause problems: ...

Get GNU Octave now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.