Why does setdiff answer depend on order of arguments?
Mostra commenti meno recenti
>>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??
Risposta accettata
Più risposte (2)
madhan ravi
il 9 Set 2019
Modificato: madhan ravi
il 9 Set 2019
bob not in bill (nothing unique all elements of bob belong to bill)
help setdiff
1 Commento
Brian Wilson
il 10 Set 2019
Walter Roberson
il 9 Set 2019
0 voti
setdiff implements set subtraction A \ B which is not commutative
1 Commento
Brian Wilson
il 10 Set 2019
Categorie
Scopri di più su Characters and Strings in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!