Why does setdiff answer depend on order of arguments?
Afficher commentaires plus anciens
>>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??
Réponse acceptée
Plus de réponses (2)
madhan ravi
le 9 Sep 2019
Modifié(e) : madhan ravi
le 9 Sep 2019
bob not in bill (nothing unique all elements of bob belong to bill)
help setdiff
1 commentaire
Brian Wilson
le 10 Sep 2019
Walter Roberson
le 9 Sep 2019
0 votes
setdiff implements set subtraction A \ B which is not commutative
1 commentaire
Brian Wilson
le 10 Sep 2019
Catégories
En savoir plus sur Characters and Strings dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!