Condition number of Hilbert matrix depending on MATLAB build??

조회 수: 3 (최근 30일)
Alessandro Russo
Alessandro Russo 2021년 1월 6일
댓글: Alessandro Russo 2021년 1월 6일
Hi,
I am a teacher of Numerical Analysis and one of my student noticed that the condition number of the 20x20 Hilbert matrix computed by his MATLAB is different from the one obtained by mine. The MATLAB command given is
clear; format long e; cond(hilb(20))
My result is
2.106530558070438e+18
while the student's result is
5.194395744359904e+19
I asked other students to try, and about ten of them got my result (2.1e+18) but one of them got another different result:
1.531575599359190e+18
I know that the Hilbert matrix is terribly ill-conditioned, so very sensistive to even slighest changes in the algorithms, but I do not expect that different instances of MATLAB give different results. Any explanation? I have also collected the output of the ver command, but it is not very illuminating. Could you please try the experiment yourself?
Thanks
Alessandro
  댓글 수: 2
Bjorn Gustavsson
Bjorn Gustavsson 2021년 1월 6일
Sure thing:
2.121145569096015e+18
With matlab version 2020a in Ubuntu.
Alessandro Russo
Alessandro Russo 2021년 1월 6일
So this is a new value! Meanwhile I collected another 1.53e+18.

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

채택된 답변

Bruno Luong
Bruno Luong 2021년 1월 6일
편집: Bruno Luong 2021년 1월 6일
You and the students should NOT expect COND returns identical result, especially for ill-conditionned matrix like Hilbert matrix. COND invokes SVD and the document here is what one can read officially
"Different machines and releases of MATLAB can produce different singular vectors that are still numerically accurate. Corresponding columns in U and V can flip their signs, since this does not affect the value of the expression A = U*S*V'."

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Hilbert and Walsh-Hadamard Transforms에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by