Matrix multiplied by inverse is not giving correct answer

12 次查看(过去 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
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
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

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by