필터 지우기
필터 지우기

Solve Ax=b with LU factorization

조회 수: 6 (최근 30일)
Joanie
Joanie 2017년 9월 11일
편집: John D'Errico 2017년 9월 11일
I'm trying to solve A*x = b with LU decomposition and back substitution. Where x is the unknown vector.
A =
350 0 0 0 0
-1 0 0 0 0.0091
5 0 0 0 0
0.0095 0 0 0 1
0 -1 0 0 0.0091
b =
1
0
2
1
But I always end up with: Matrix is singular to working precision
Hope someone can provide me with a working code.

채택된 답변

John D'Errico
John D'Errico 2017년 9월 11일
편집: John D'Errico 2017년 9월 11일
The matrix is singular! Hint: read the error message. There is no solution.
Worse, there could NEVER be a solution, even if the matrix was not singular!!!!!!!
A is a 5x5 matrix. b is a 4x1 vector.
There exists no possible vector x such that A*x will be a 4x1 vector. NOT gonna happen. EVER. So asking for working code to do the impossible is a waste of CPU cycles. Trying to do that with a singular matrix? Even sillier.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by