Different results for the same equation
조회 수: 1 (최근 30일)
이전 댓글 표시
Why E1 is different than E3, though lambda(1)= lambda(3)
댓글 수: 0
답변 (1개)
Steven Lord
2021년 1월 14일
lambda(1) is displayed the same as lambda(3) but its value is not identical to the value of lambda(3).
A = [-10 10 -15; 10 5 -30; -5 -10 0];
lambda = eig(A)
lambda(1) == lambda(3) % false
lambda(1)-lambda(3) % very small but not 0
댓글 수: 2
Walter Roberson
2021년 1월 14일
A = [-10 10 -15; 10 5 -30; -5 -10 0];
lambda = eig(A)
lambda(1) + 15
lambda(3) + 15
The third lambda is an exact integer. When you calculate A-lambda(3)*eye(3) you get exact integers, and rref() is able to calculate exact integer outputs.
When you use format short (which is the default) and all of the outputs to be displayed are exact integers, then no decimal points are shown. When any of the outputs are not exact integers, then decimal points are shown in all of the outputs.
참고 항목
카테고리
Help Center 및 File Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!