Matlab-condition number of a matrix

Using matlab,I found that the condition number of matrix A(using the infinity norm,Koo(A)) (where A is is the Hilbert matrix with dimension n=200 ) is 3.8586e+020
Is this right or am I wrong?

 Accepted Answer

John D'Errico
John D'Errico on 23 Nov 2013
No. It is probably a bigger number than that However, you forget the limits of floating point arithmetic.

7 Comments

How can I find the right number for the condition number of the matrix???
evi
evi on 23 Nov 2013
Edited: evi on 24 Nov 2013
Or do you mean that I can't find the exact number,using matlab??
When I run my code,I get this warning message: Matrix is close to singular or badly scaled.Results may be inaccurate.RCOND:2.591645e-021.What does this mean?
The "true" condition number? The that value will be difficult to compute using doubles. You would need to work symbolically, and even that will take some serious effort. For example, if you converted a matrix of doubles to syms, they are already in error because the doubles are only floating point approximations to the numbers in your matrix. So knowing the exact condition number is only something one could do by building the matrix as a symbolic one directly. I suppose you could use my HPF toolbox to work with high precision floating point numbers, but I've never written an SVD tool for HPF.
John D'Errico
John D'Errico on 24 Nov 2013
Edited: John D'Errico on 24 Nov 2013
MATLAB is telling you that your matrix is numerically singular. (READ THE MESSAGE! It did say the matrix is close to singular.) A numerically singular matrix is one that cannot be distinguished from a singular matrix when floating point arithmetic is employed.
Nice...Thank you...!
As a followup, I decided to add a few linear algebra tools to HPF. So far this am, chol, LU, det were easy and now done. svd will take longer.

Sign in to comment.

More Answers (1)

evi
evi on 24 Nov 2013
I have also an other question.If we have the tridiagonal matrix,that has the number 4 at the main diagonal and the number 1 at the first diagonal below the main diagonal and at the first diagonal above the main diagonal,I get that the condition number,using the infinity norm,is 3,independent from the dimension I give..Is this right???If yes,why does this happen??Why isn't there any change of the condition number??

2 Comments

John D'Errico
John D'Errico on 24 Nov 2013
Edited: John D'Errico on 24 Nov 2013
If you want to ask a separate question, then ask it as another question, not as an answer to your first question. When you ask it like this, you cause confusion, and make it difficult for others to follow.
Ok,sorry!!

Sign in to comment.

Asked:

evi
on 23 Nov 2013

Commented:

evi
on 24 Nov 2013

Community Treasure Hunt

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

Start Hunting!