Solve systems of linear equations xA = B for x
x = B/A solves the system of linear equations x*A = B for x. The matrices A and B must contain the same number of columns. MATLAB® displays a warning message if A is badly scaled or nearly singular, but performs the calculation regardless.
If A is a scalar, then B/A is equivalent to B./A.
If A is a square n-by-n matrix and B is a matrix with n columns, then x = B/A is a solution to the equation x*A = B, if it exists.
If A is a rectangular m-by-n matrix with m ~= n, and B is a matrix with n columns, then x = B/A returns a least-squares solution of the system of equations x*A = B.
Solve a system of equations that has a unique solution, x*A = B.
A = [1 1 3; 2 0 4; -1 6 -1]; B = [2 19 8]; x = B/A
x = 1.0000 2.0000 3.0000
Solve an underdetermined system, x*C = D.
C = [1 0; 2 0; 1 0]; D = [1 2]; x = D/C
Warning: Rank deficient, rank = 1, tol = 6.280370e-16. x = 0 0.5000 0
MATLAB issues a warning but proceeds with calculation.
Verify that x is not an exact solution.
ans = 0 -2
Coefficient matrix, specified as a vector, full matrix, or sparse matrix. If A has n columns, then B must have n columns.
Data Types: single | double
Complex Number Support: Yes