Example

 

 W1: {{1, 4, 7},

      {2, 5, 8},

      {3, 6, 0}}

 

 W2: {1,

      2,

      3}

 

 W3: W1 *^ W2

 

 W3 == {30,

        36,

        15}

 

 W4: W1 ^ W3

 

 W4 == {1,

        2,

        3}

 

W4 solves the following system of equations:

 

  x + 4y + 7z = 30

 2x + 5y + 8z = 36

 3x + 6y = 15

 

 x == 1

 y == 2

 z == 3

 
Example

 

Now consider an over-determined system:

 

A = {{1, 4, 7},

     {2, 5, 8}, 

     {3, 6, 0}, 

     {1, 2, 1}} 

 

x = {30,

     36, 

     15, 

     2} 

 

b = A ^ x

 

b == {-1.8,

       3.2, 

       2.8} 

 

This example solves the following over-determined system of equations using least squares:

 

 x + 4y + 7z = 30 

2x + 5y + 8z = 36

3x + 6y      = 15

 x + 2y + z  = 2 

 

Note: Remember, for true matrix multiplication, use the *^ operator or the MMULT function. If you use the * operator to multiply matrices, DADiSP will apply the * operator element by element in a column-oriented operation.