Matrix multiplied by inverse is not giving correct answer
조회 수: 6 (최근 30일)
이전 댓글 표시
The inverse of a matrix multiplied by itsef should give an identity matrix but the result I get is this: [0 0 0; -4 0 0; -4 0 0]
댓글 수: 1
Vladimir Sovkov
2020년 7월 26일
Try
det(sym(a))
It is strict zero. Hence, there is no inverse matrix indeed. Matlab is quite correct here.
답변 (1개)
David Goodmanson
2020년 7월 26일
Matlab is telling you the answer, that the matrix (call it M) is close to singular or badly scaled (singular in this case). M has a ridiculously small condition number of 2e-18. It doesn't have an inverse, and the one it comes up with is due to numerical precision issues.
If M had an inverse, it would be impossible to have a nonzero column vector u such that M*u = 0. However,
M = [1 2 3;4 5 6;7 8 9]
M*[1; -2; 1]
ans =
0
0
0
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!