MATLAB: Is the output of RCOND function not equal to the reciprocal of the output of COND function

condMATLABrcondsvd

When I execute the following commands:
A = magic(3);
C = cond(A)
R = rcond(A)
I receive the following results
C = 4.330127018922193
R = 0.187500000000000
Why is the value of R quite different than the value of '1/C'?

Best Answer

The reason why the output of the RCOND function is not equal to the reciprocal of the COND function output for a matrix is that the functions are using different norms in the calculations. The COND function returns the '2-norm' condition number by default whereas the RCOND function returns an estimate for the reciprocal of the condition of the matrix in terms of the '1-norm'.
If you specify the COND function to return '1-norm condition number' with an additional input parameter as in the following commands, you will see that the results in the variables 'foo_1' and 'foo_2' are very similar:
A = magic(3);
% Estimating the reciprocal of 1-norm condition number using the COND
foo_1 = 1/cond(A,1);
% Using RCOND function for estimation
foo_2 = rcond(A);
Please also note that the functions RCOND and COND use different LAPACK routines. Also note that compared to the COND function, RCOND is a more efficient, but less reliable, method of estimating the conditioning of a matrix. The function COND uses the LAPACK routines for singular value decomposition which are DGESVD and ZGESVD for real and complex matrices of type 'double', respectively, whereas the function RCOND uses the LAPACK routines DLANGE, DGETRF, and DGECON for real matrices and the routines ZLANGE, ZGETRF, and ZGECON for complex matrices of type 'double'.