How to solve linear equation with singular Matrix?
23 views (last 30 days)
Show older comments
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.
0 Comments
Answers (3)
Ibrahim Albaik
on 10 Feb 2020
I have the same problem and still looking for solutions?
1 Comment
John D'Errico
on 11 Nov 2020
Please don't use an answer just for a me too response. Learn about comments.
John D'Errico
on 11 Nov 2020
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.
0 Comments
See Also
Categories
Find more on Linear Algebra in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!