MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: removing subelements

  • To: mathgroup at
  • Subject: [mg56119] Re: removing subelements
  • From: Jon Harrop <usenet at>
  • Date: Sat, 16 Apr 2005 03:51:52 -0400 (EDT)
  • References: <d3o0ta$bqn$>
  • Sender: owner-wri-mathgroup at

borges2003xx at wrote:

> i'm a newbie. How implement the _faster functon_ which removes in a
> list every element that are a subelement.
> which means
> f[x]:=  {..,{1,2,3,4},..,{2,3},..} removes {2,3}.

I'm not exactly sure what you're after but Complement[...] may do the trick:

In[1]:= Complement[{1,2,3,4}, {2,3}]
Out[1]= {1, 4}

Dr Jon D Harrop, Flying Frog Consultancy

  • Prev by Date: sparse matrix question
  • Next by Date: Re: Can you type a command and have Mathematica show the parameters?
  • Previous by thread: Re: Re: FortranForm o/p question
  • Next by thread: Re: removing subelements