Skip to content

setdiff

set · scripts/set/setdiff.m

C = setdiff (A, B)
C = setdiff (A, B, "rows")
C = setdiff (A, B, "sorted" | "stable" | "legacy")
[C, ia] = setdiff (...)

Distinct elements of A that do not occur in B.

Options are matched case-insensitively and may be combined, except that
"sorted", "stable" and "legacy" are mutually exclusive.  The result has
the orientation of A.  "ia" is a column vector with C = A(ia).