Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 2.240406e-24.

조회 수: 2 (최근 30일)
Hi, I have an operation like this: inv(A)*B; and i get this warning:
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 2.240406e-24.
I checked everything and the matrix's inputs are just badly scaled ( but the data is exacly what it is). Besides, determinents of both A, inv(A) are not zero. But the determinent of A is very very very small, nearly to zero.
Do i have to worry about the accurace of my operation or can do further operation on inv(A)*B?. I just want to make sure no mistakes happened because of ill-seriesness.
Thanks.
  댓글 수: 3

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

답변 (1개)

Matt J
Matt J 2020년 1월 14일
Even with A\B, you cannot expect reliable behavior with RCOND as small as 2.240406e-24. For all intents and purposes, your matrix is singular.
  댓글 수: 2
Walter Roberson
Walter Roberson 2020년 1월 15일
Sometimes you can side-step the errror message by using
sym(A)\sym(B)
sym() applied to the arrays would approximate each floating point number as an extended algebraic number (square roots, pi). But it will not always use the approximation you might expect. For example it would approximate 2.7178-1.414 as 6519/5000 instead of exp(1) - 2^(1/2) . Or it would approximate pi-313*eps as pi instead of as 1768559438007071/562949953421312
You can get more consistency by using
sym(A, 'f')\sym(B, 'f')
... Though chances are that if you get pushed to the point where you are using sym(A)\sym(B) to avoid error messages, then you should have been using symbolic computations to build up A and B in the first place
Using this technique with sym() to avoid the error message is, most of the time, a case Garbage In, Garbage Out: it takes in your garbage coefficients, and says, "For the sake of following rules blindly, we will pretend that those numbers are infinitely accurate, and give you the result as if they were, even though mathematically if even one of those numbers had been different in the 16th decimal place, you would have gotten a very different answer"

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

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by