matlab的矩陣左除(AB)是如何實現的?

對於一些超定矩陣方程AX=B, 若直接用X=pinv(A)*B求解,則會報錯(Use svds for sparse singular values and vectors),但用X=AB則可以順利求出解。求問大神,matlab的矩陣左除(AB)是怎麼實現的呢?如果類似的這種情況下,求出的解是否和X=(A的Moore-Penrose逆)*B相同呢?謝謝!~


善用help:

The mldivide AlgorithmThe mldivide operator employs different algorithms to handle different kinds of coefficient matrices. The various cases are diagnosed automatically by examining the coefficient matrix.
Permutations of Triangular Matrices
mldivide checks for triangularity by testing for zero elements. If a matrix A is triangular, MATLAB software uses a substitution to compute the solution vector x. If A is a permutation of a triangular matrix, MATLAB software uses a permuted substitution algorithm.
Square Matrices
If A is symmetric and has real, positive diagonal elements, MATLAB attemptsa Cholesky factorization. If the Cholesky factorization fails, MATLAB performsa symmetric, indefinite factorization. If A is upper Hessenberg, MATLAB uses Gaussian elimination to reduce the system to a triangular matrix. If A is square but is neither permuted triangular, symmetric and positive definite, or Hessenberg, then MATLAB performs a general triangular factorization using LU factorization with partial pivoting (see lu).
Rectangular Matrices
If A is rectangular, mldivide returns a least-squares solution. MATLAB solves overdetermined systems with QR factorization (see qr). For an underdetermined system, MATLAB returns the solution with the maximum number of zero elements.


In the left division, the solution X is obtained numerically with a method that is based on Gauss elimination.


廣義矩陣逆,算出來了就可以了


推薦閱讀:

一直不解,為什麼如此定義矩陣的乘法,為什麼這樣一種怪異的乘法規則卻能夠在實踐中發揮如此巨大的功效?
有沒有三維的矩陣?現在接觸的矩陣似乎僅為二維的(行與列)
如何理解矩陣的「秩」?
如何通俗易懂地解釋遺傳演算法?有什麼例子?
如何看待IMO 2017中國隊團體總分位列第二?

TAG:數學 | MATLAB | 矩陣 |