Mathematica 9 is now available
 Documentation / Mathematica / Built-in Functions / Lists and Matrices / List Operations  /
Complement

  • Complement[ eall , , , ... ] gives the elements in eall which are not in any of the .
  • The list returned by Complement is sorted into standard order.
  • Example: Complement[ a,b,c,d,e , a,c , d ].
  • Complement[ eall , , ... , SameTest-> test ] applies test to each pair of elements in eall and the to determine whether they should be considered the same.
  • See the Mathematica book: Section 1.8.8.
  • See also: Intersection, Union.

    Further Examples

    This gives all those elements of the first list that do not appear in either of the other two lists.

    In[1]:=

    Out[1]=



    Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
    THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
    SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.