问题
In matlab
, how can I implement the following?
Say that I have some set A
and another set B
, both of which have some elements. How can I write a function that returns only the values of B
that are not in A
(relative complement of A in B B\A
?
Thanks.
回答1:
use setdiff
dif = setdiff( A, B )
来源:https://stackoverflow.com/questions/14770613/elements-in-a-set-that-are-not-elements-of-another-set-relative-complement