'\':
Backslash or matrix left division. If A is a square matrix,A\B is roughly the same as inv(A)*B, except it is computed in adifferent way. If A is an n-by-n matrix and B is a column vectorwith n components, or a matrix with several such columns, then X =A\B is the solution to the equation AX = B. A warning message isdisplayed if A is badly scaled or nearly singular. A\EYE(SIZE(A))produces the inverse of A. See the reference page for mldivide formore information.
If A is an m-by-n matrix with m ~= n and B is a column vectorwith m components, or a matrix with several such columns, then X =A\B is the solution in the least squares sense to the under- oroverdetermined system of equations AX = B. The effective rank, k,of A is determined from the QR decomposition with pivoting. Asolution X is computed that has at most k nonzero components percolumn. If k < n, this is usually not the samesolution as pinv(A)*B, which is the least squares solution with thesmallest norm||X||.
A\EYE(SIZE(A)) producesa
generalized inverse of A.
mldivide \:
Left matrix division
mldivide(A,B) and the equivalent A\B perform matrix leftdivision (back slash). A and B must be matrices that have the samenumber of rows, unless A is a scalar, in which case A\B performselement-wise division — that is, A\B = A.\B.
If A is a square matrix, A\B is roughly the same as inv(A)*B,except it is computed in a different way. If A is an n-by-n matrixand B is a column vector with n elements, or a matrix with severalsuch columns, then X = A\B is the solution to the equation AX = B.A warning message is displayed if A is badly scaled or nearlysingular.
If A is an m-by-n matrix with m ~= n and B is a column vectorwith m components, or a matrix with several such columns, then X =A\B is the solution in the least squares sense to the under- oroverdetermined system of equations AX = B. In other words, Xminimizes norm(A*X - B), the length of the vector AX - B. The rankk of A is determined from the QR decomposition with columnpivoting. The computed solution X has at most k nonzero elementsper column. If k < n, this is usually not the samesolution as x = pinv(A)*B, which returns a least squaressolution.
就是说当A是N阶方阵B为N行的列向量时,X=A\B就是线性方程组A*X=B的解,算法是用高斯消去法。A\EYE(SIZE(A))产生的是方阵A的逆矩阵。
如果A是M*N的矩阵且M≠N,B是跟A行数(M行)相同的列向量时,X=A\B是非满秩的线性方程组A*X=B的解系,A的秩K由QR分解得出。如果K
总而言之,A\B就是求A*X=B的解,你可以看作是A的逆矩阵,只不过是广义逆矩阵,这样A不是方阵也可以计算的。
至于A/B,在解线性方程组上比\少用一些,因为通常都把B写成列向量,所以用反除\就可以了。用/的话,B通常是行向量。
可以把B/A看作是X*A=B的解,这里B的列数等于A的列数。
A\B=pinv(A)*B
A/B=A*pinv(B)
可见,'\'用的是高斯消元法。
同时还查到:
Square Matrices
If A is symmetric and has real, positive diagonal elements, MATLABattempts a Cholesky factorization. If the Cholesky factorizationfails, MATLAB performs a symmetric, indefinite factorization. If Ais upper Hessenberg, MATLAB uses Gaussian elimination to reduce thesystem to a triangular matrix. If A is square but is neitherpermuted triangular, symmetric and positive definite, orHessenberg, MATLAB performs a general triangular factorizationusing LU factorization with partial pivoting.