MATLAB Answers

Condition number of Hilbert matrix depending on MATLAB build??

2 views (last 30 days)
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
while the student's result is
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:
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?

Accepted Answer

Bruno Luong
Bruno Luong on 6 Jan 2021
Edited: Bruno Luong on 6 Jan 2021
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'."

More Answers (0)




Community Treasure Hunt

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

Start Hunting!