## Documentation Center |

Set difference of two arrays

` C = setdiff(A,B)` returns
the data in

If

`A`and`B`are numeric arrays, logical arrays, character arrays, categorical 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.

` C = setdiff(A,B,'rows')` treats
each row of

The `'rows'` option does not support cell arrays.

`[ C,ia] =
setdiff(___,setOrder)` returns

`intersect` | `ismember` | `issorted` | `setxor` | `sort` | `union` | `unique`

Was this topic helpful?