HyperMath

Backslash Operator

Backslash Operator

Previous topic Next topic No expanding text in this topic  

Backslash Operator

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

The system Ax=b can be solved as x = A\b.  This is equivalent to x = Inv(A)*b when A is square.  It is equivalent to Pinv(A)*b when A is not square. A and b must have the same number of rows.  If b is a matrix, the system is solved for each column separately, resulting in multiple solutions.

Here is an example:

A = [1,2,3;41,15,6;17,8,9];// square matrix

b = [11;22;21];

print(A\b)

The result is:

[Matrix] 3 x 1

      -1.7368

       6.1579

      0.14035

 

If b is a two column matrix, for example, then the output would be the solutions to two systems, one for each column of b:

b = [11,21;13,33;21,24];

print(A\b)

The result is:

[Matrix] 3 x 2

         -1.5         -5.4079

          4.5          18.355

       1.1667         -3.4342