Set difference of two arrays

returns
the data in `C`

= setdiff(`A,B`

)`A`

that is not in `B`

.

If

`A`

and`B`

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

returns the values in`A`

that are not in`B`

. The values of`C`

are in sorted order.If

`A`

and`B`

are tables, then`setdiff`

returns the rows from`A`

that are not in`B`

, with repetitions removed. The rows of table`C`

are in sorted order.

`[`

returns `C`

,`ia`

] =
setdiff(___,`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`

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

.

Was this topic helpful?