Why does setdiff answer depend on order of arguments?
Mostrar comentarios más antiguos
>>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??
Respuesta aceptada
Más respuestas (2)
madhan ravi
el 9 de Sept. de 2019
Editada: madhan ravi
el 9 de Sept. de 2019
bob not in bill (nothing unique all elements of bob belong to bill)
help setdiff
1 comentario
Brian Wilson
el 10 de Sept. de 2019
Walter Roberson
el 9 de Sept. de 2019
0 votos
setdiff implements set subtraction A \ B which is not commutative
1 comentario
Brian Wilson
el 10 de Sept. de 2019
Categorías
Más información sobre Characters and Strings en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!