Matrix is close to singular or badly scaled

조회 수: 5 (최근 30일)
xueqi
xueqi 2013년 5월 31일
Dear Fellows,
I am trying to find out the answers for
if true
% inv([1.4326e+21,8.5958e+21;0.2001,2.2005])
end
and I got the error message and answer is
endWarning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.661695e-23.
ans =
0.0000 -6.0009
-0.0000 1.0001
I know my matrix is badly scaled, but what I should do about this if I have to find the accurate inverse of this kind of matrix?
Cheers

채택된 답변

Kye Taylor
Kye Taylor 2013년 5월 31일
편집: Kye Taylor 2013년 5월 31일
There is a closed form expression for the inverse of a 2-by-2 matrix here (see equation 4).
So your inverse is
A = [1.4326e+21,8.5958e+21;0.2001,2.2005];
Ai = 1/det(A)*[2.2005,-8.5958e+21;-0.2001,1.4326e+21];

추가 답변 (2개)

Matt J
Matt J 2013년 5월 31일
편집: Matt J 2013년 5월 31일
I know my matrix is badly scaled, but what I should do about this if I have to find the accurate inverse of this kind of matrix
What is the right hand side of the equation you're solving? If you're solving equations that look like this,
1.4326e+21 * x + 8.5958e+21 * y = 2e21
0.2001 * x + 2.2005 * y = 1
then the problem is simply that the coefficients in the first equation are measured in the wrong units. Rescale the system to this equivalent one
1.4326*x + 8.5958*y = 2
0.2001*x + 2.2005*y = 1
and now your system is much better conditioned.
  댓글 수: 1
Matt J
Matt J 2013년 5월 31일
As a footnote, you should not be using INV. You should be using MLDIVIDE or backslash.

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


Azzi Abdelmalek
Azzi Abdelmalek 2013년 5월 31일
In your case the result is correct, you can check:
a*inv(a) % is an identity matrix

카테고리

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