Set intersection of two arrays

returns
the data common to both `C`

= intersect(`A,B`

)`A`

and `B`

with
no repetitions.

If

`A`

and`B`

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

returns the values common to both`A`

and`B`

. The values of`C`

are in sorted order.If

`A`

and`B`

are tables, then`intersect`

returns the set of rows common to both tables. The rows of table`C`

are in sorted order.

Was this topic helpful?