Solve a system of linear equations. The matrix must be square and real. The left divide operator "\" provides the same functionality as the solve script command for dense matrices.
Syntax |
Description |
---|---|
x = A\b; |
Returns solution for A x = b. |
Simultaneous solutions (multiple-column b) are supported. Result x will have same shape as input b.
Example
This is a simple example of the command.
A = [1,2;3,4]; b = [1;2]; x = A\b; ?x; result: 0 0.5
See Also
List of commands , solve , inv