Condition number of empty matrix
Show older comments
if is a 0 x 0 matrix, then cond( A ) returns 0. However, we know that the condition number is always >= 1. Also, one could argue that the empty matrix is an identity matrix, and hence its condition number should equal 1.
Any particular reason why matlab made this choice?
7 Comments
jessupj
on 20 Jun 2022
(unrelated, but i'm curious how you would argue that a null object is the identity matrix. what space is it the identiy on?)
Robert van de Geijn
on 20 Jun 2022
jessupj
on 21 Jun 2022
I agree that cond([]) should be undefined. It needs a ratio of eigenvalues, and it's not clear to me ew's are well-defined for operators on R^0 (or whatever it is here).
You're working in the space of zero-tuples, whose only element (pardon my non-algebraic mindedness) is a unique empty set. it's not actually an empty n-typle as in the argument above ( A is 0x0, x is 0x1). It seems that formally you'd have operator A=[] (just empty, not actually 'empty x empty') and x = [], right?
Distinguishing them using empty vs. singleton dimensions feels completely 'artificial' or at least 'numerical' (but I do like the argument for why MATLAB shouldn't give you a zero).
David Goodmanson
on 22 Jun 2022
Hi Robert
I don't believe 0 is a satisfactory result, but since the condition number is the ratio of the largest to smallest singular value, you can make a good case that the result should be [ ].
A = [];
s = svd(A)
s = 0×1 empty double column vector
isempty(s)
ans = logical
1
condvalue = max(s)/min(s)
condvalue = []
% the simpler variable [] gives the same ratio
% size([])
ans = 0 0
[]/[]
ans = []
s has some funky dimensions, but it's still empty, and the resulting condition number equals [ ].
I think you could also make a good case for the condition number equaling NaN, since the ratio of the size of two empty sets seems ill defined.
Robert van de Geijn
on 22 Jun 2022
Robert van de Geijn
on 22 Jun 2022
Accepted Answer
More Answers (0)
Categories
Find more on Performance and Memory in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!