intersect

Syntax

intersect(vector_1, vector_2)

Argument

vector_1
The first vector to be inspected for common elements.
vector_2
The second vector to be inspected for common elements.

Example

Templex Expression Result
a = {2,3,2,5,0,1,6}

b = {1,2,2,2,4}

intersect(a,b)

{1,2,2}

Comments

This function returns a sorted vector of all of the elements in common between the two input vectors. If the input vectors have no elements in common, an error is returned. Repeated common values are repeated in the result.