| MATLAB Functions | Help Desk |
setxor
Set exclusive-or of two vectors
c = setxor(a,b) c = setxor(a,b,'rows') [c,ia,ib] = setxor(...)
c = setxor(a,b)
returns the values that are not in the intersection of a and b. The resulting vector is sorted.
c = setxor(a,b,'rows')
when a are b are matrices with the same number of columns returns the rows that are not in the intersection of a and b.
[c,ia,ib] = setxor(...)
also returns index vectors ia and ib such that c is a sorted combination of the elements c = a(ia) and c = b(ib) or, for row combinations, c = a(ia,:) and c = b(ib,:).
A non-vector input array A is regarded as a column vector A(:).
a = [-1 0 1 Inf -Inf NaN];
b = [-2 pi 0 Inf];
c = setxor(a,b)
c =
-Inf -2.0000 -1.0000 1.0000 3.1416 NaN
intersect Set intersection of two vectors
ismember True for a set member
setdiff Set difference of two vectors
union Set union of two vectors
unique Unique elements of a vector