Solving Ax = B for x
x = mldivide(A, B)
x = A\B
- It solves the system of linear equations Ax = B for x.
Bshould be matrices having the same numbers of rows; otherwise, elementwise division
ldivide(A,B)) is performed if any of the following conditions is satisfied:
|Scalar||Array of any size and any number of dimensions|
|n-dimensional array, n > 2||Scalar|
Ais a square matrix, LU decomposition is used. It returns an error if
Ais singular. It reports a warning, and proceeds to compute a solution anyway, if the reciprocal of the condition number of
Ais less than
eps * norm(A), i.e.,
Anearly singular or badly conditioned.
Ais not square, QR decomposition is used to obtain a least square solution of Ax = B. It reports a warning, and proceeds to compute a solution anyway, if
Ais rank deficient.