How to solve linear equation with singular Matrix?

37 ビュー (過去 30 日間)
Erik Gábor
Erik Gábor 2018 年 2 月 4 日
編集済み: Walter Roberson 2020 年 11 月 11 日
I have a problem with the solution this linear equations AX=B, when A,X and B are matrices. The matrix A is singular matrix. Matrices A and B have just only 1 and 0.

回答 (3 件)

Ibrahim Albaik
Ibrahim Albaik 2020 年 2 月 10 日
I have the same problem and still looking for solutions?
  1 件のコメント
John D'Errico
John D'Errico 2020 年 11 月 11 日
Please don't use an answer just for a me too response. Learn about comments.

サインインしてコメントする。


Rore
Rore 2020 年 11 月 11 日
編集済み: Walter Roberson 2020 年 11 月 11 日

John D'Errico
John D'Errico 2020 年 11 月 11 日
A difficult question to answer, because there is no unique solution, and very likely, there is no exact solution. Really, it comes down to linear algebra 101. And possibly, you are trying to solve the problem in GF(2), thus the field of integers modulo 2. That would further complicate the problem.
What does it mean to try to solve the linear system A*x = b, for a square matrix A? Essentially, when you multiply a matrix A by any vector, you form a linear combination of the columns of the matix A. That is, A*x combines the columns in a way defined by the vector x. But when the matrix is singular, it is true that some of the columns of the matrix can be written as themselves a linear combination of the other columns. So there is no unique solution, even if a solution exists. And the odds are good that no exact solution will exist.
The standard example, (assuming you are not trying to work in GF(2)) is to use a pseudo-inverse. That is found in pinv, where the solution will be
x = pinv(A)*b;
Or, you could use lsqminnorm, but only in newer releases of MATLAB. (introduced in R2017b.) It will do as well.
Note that the pinv based solution will produce, since there are infinitely many solutions, the one where the vector x has minimum norm. (Note the name lsqminnorm.)
None of the above applies in the case of a GF(2) problem of course, but then you really should be careful in how you work with such a matrix, because you cannot use the traditional linear algebra tools in MATLAB.

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by