intersect
C = intersect (A, B) C = intersect (A, B, "rows") C = intersect (A, B, "sorted" | "stable" | "legacy") [C, ia, ib] = intersect (...) Distinct elements that occur in both A and B. Options are matched case-insensitively and may be combined, except that "sorted", "stable" and "legacy" are mutually exclusive. The index outputs are column vectors with C = A(ia) and C = B(ib).