Why does setdiff answer depend on order of arguments?
Ältere Kommentare anzeigen
>>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??
Akzeptierte Antwort
Weitere Antworten (2)
madhan ravi
am 9 Sep. 2019
Bearbeitet: madhan ravi
am 9 Sep. 2019
bob not in bill (nothing unique all elements of bob belong to bill)
help setdiff
1 Kommentar
Brian Wilson
am 10 Sep. 2019
Walter Roberson
am 9 Sep. 2019
0 Stimmen
setdiff implements set subtraction A \ B which is not commutative
1 Kommentar
Brian Wilson
am 10 Sep. 2019
Kategorien
Mehr zu Characters and Strings finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!