Navigation

Operators and Keywords

Function List:

C++ API

: c = intersect (a, b)
: c = intersect (a, b, "rows")
: [c, ia, ib] = intersect (…)

Return the unique elements common to both a and b sorted in ascending order.

If a and b are both row vectors then return a row vector; Otherwise, return a column vector. The inputs may also be cell arrays of strings.

If the optional input "rows" is given then return the common rows of a and b. The inputs must be 2-D matrices to use this option.

If requested, return index vectors ia and ib such that c = a(ia) and c = b(ib).

See also: unique, union, setdiff, setxor, ismember.

Package: octave