Set exclusive OR of two arrays

returns
the data of `C`

= setxor(`A,B`

)`A`

and `B`

that are
not in their intersection (the symmetric difference).

If

`A`

and`B`

are numeric arrays, logical arrays, character arrays, categorical arrays, datetime arrays, duration arrays, or cell arrays of strings, then`setxor`

returns the values that occur in`A`

or`B`

, but not both. The values of`C`

are in sorted order.If

`A`

and`B`

are tables, then`setxor`

returns the rows that occur in one or the other of the two tables, but not both. The rows of table`C`

are in sorted order.

treats
each row of `C`

= setxor(`A,B`

,'rows')`A`

and each row of `B`

as
single entities and returns the rows of matrices `A`

and `B`

that
are not in their intersection. The rows of `C`

are
in sorted order.

The `'rows'`

option does not support cell arrays,
unless one of the inputs is either a categorical array or a datetime
array.

`[`

also returns index vectors `C`

,`ia`

,`ib`

]
= setxor(`A,B`

)`ia`

and `ib`

.

If

`A`

and`B`

are numeric arrays, logical arrays, character arrays, categorical arrays, datetime arrays, duration arrays, or cell arrays of strings, then`C`

is a sorted combination of the elements`A(ia)`

and`B(ib)`

.If

`A`

and`B`

are tables, then`C`

is a sorted combination of the rows of`A(ia,:)`

and`B(ib,:)`

.

`[`

returns `C`

,`ia`

,`ib`

]
= setxor(___,`setOrder`

)`C`

in
a specific order using any of the input arguments in the previous
syntaxes. `setOrder='sorted'`

returns the values
(or rows) of `C`

in sorted order. `setOrder='stable'`

returns
the values (or rows) of `C`

in the same order as `A`

and `B`

.
If no value is specified, the default is `'sorted'`

.

Was this topic helpful?