Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Core Language > List Manipulation > Rearranging & Restructuring Lists > Intersection () >
Mathematica > Data Manipulation > Handling Arrays of Data > Rearranging & Restructuring Lists > Intersection () >
Mathematica > Data Manipulation > Image Processing & Analysis > Basic Image Manipulation > Handling Arrays of Data > Rearranging & Restructuring Lists > Intersection () >

Intersection

Intersection
gives a sorted list of the elements common to all the .
  • If the are considered as sets, Intersection gives their intersection.
  • The must have the same head, but it need not be List.
  • Intersection[list1, ..., SameTest->test] applies test to each pair of elements in the to determine whether they should be considered the same.
Find elements common to all the lists given:
Enter using Esc inter Esc:
Find elements common to all the lists given:
In[1]:=
Click for copyable input
Out[1]=
 
Enter using Esc inter Esc:
In[1]:=
Click for copyable input
Out[1]=
Intersection works with any head, not just List:
Find divisors common to 45 and 78:
If there is no intersection, the result is :
New in 1 | Last modified in 3
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF