MATLAB: Does setdiff answer depend on order of arguments

cell stringssetdiff

>>bob = {'a','b','c'};
>>bill = {'a','b','c', 'd','e'}
As expected,
>>A = setdiff(bill,bob)
A =
'd' 'e'
BUT
>> B = setdiff(bob,bill)
B =
Empty cell array: 1-by-0
WHY??

Best Answer

Were you expecting the output to contain elements that are only in one of the inputs but not both? That's not what setdiff does. If that is what you want to do, use setxor instead.