all(logical.empty)
Discuss!
7 Comments
Time DescendingWell discussed over a looooong time:
https://blogs.mathworks.com/loren/2009/11/12/empty-arrays-with-flow-of-control-and-logical-operators
Roger Stafford explained it very nicely with this example:
any(union(A,B)) = any(A) | any(B)
all(union(A,B)) = all(A) & all(B)
However, as best I can tell the doc page(s) doesn't explain these results:
all(logical.empty(3,0)) % 1
all(logical.empty(3,0),1) % 2
all(logical.empty(3,0),2) % 3
all(logical.empty(0,3)) % 4
all(logical.empty(0,3),1) % 5
all(logical.empty(0,3),2) % 6
I think those results are all consistent (I had to think about them for a bit), but the doc page is silent on behavior with an empty 2D input with size that's not 0x0 (as was also noted as far back as 2015 in the linked Answer thread).
I think the doc is silent on the following cases as well, and I'm having trouble convincing myself that they are consistent with the original example
all(logical.empty,1)
all(logical.empty,2)
As Wittgenstein observed, everything that is not the case, is. And vice versa.
Well, I learned something new today—the meaning of the phrase vacuous truth.
Since one new thing learned is my daily limit, I'm going back to bed.
True.
Sign in to participate