setxor
Returns the elements exclusive to a or b.
Syntax
setxor(a,b)
setxor(a,b,'rows')
[c,ia,ib]=setxor(a,b)
Inputs
- a,b
- The sets of elements.
- 'rows'
- Find the set difference along the rows as opposed to the elements.
Outputs
- c
- Elements exclusive to a or b in ascending order.
- ia, ib
- a(ia) and b(ib) are disjoint sets that compose c.
Examples
setxor([1,5,2;6,2,6],[9;0;1;2])
ans = [Matrix] 4 x 1
0
5
6
9
setxor([1,5,2;6,2,6],[9 0 1],'rows')
ans = [Matrix] 3 x 3
1 5 2
6 2 6
9 0 1
[c,ia,ib]=setxor([1,5,2;6,2,6],[9;0;1;2])
c = [Matrix] 4 x 1
0
5
6
9
ia = [Matrix] 2 x 1
3
6
ib = [Matrix] 2 x 1
2
1