Incorrect matrix computation: a*inv(a) does not produce the identity matrix

I'm new to matlab, and just downloaded the program using all of the defaults in the installer. While going through the tutorials I noticed that inv(a), where a is a matrix, was not giving the correct answer. I attached a screenshot of my command window. I've restarted the program several times, but got the same answer each time I tried this calculation.
Did something go wrong with my download? Or is there a way to fix this without having to reinstall? Hopefully I'm overlooking something simple. Any advise would be appreciated.
Thanks!

댓글 수: 1

Rik
Rik 2018년 8월 7일
편집: Rik 2018년 8월 7일
You overlooked the warning. It is not always possible to invert a matrix, apparently you hit up against such a case. The determinant is -9.5162e-16 for this matrix, which is very close to machine precision for doubles (which is 2.2204e-16).

댓글을 달려면 로그인하십시오.

 채택된 답변

James Tursa
James Tursa 2018년 8월 7일
편집: James Tursa 2018년 8월 7일

0 개 추천

The "a" matrix you are using is not full rank and does not have an inverse. That is what the warning message is trying to alert you to. It is good that MATLAB is reliably telling you each time you try it that there is something wrong with trying to find the inverse of this matrix. The row dependency can be easily seen:
2 * (2nd row) - (1st row) = (3rd row)

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Downloads에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by