MathGroup Archive 2003

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

Search the Archive

Extracting Terms From a List

  • To: mathgroup at smc.vnet.net
  • Subject: [mg44183] Extracting Terms From a List
  • From: "Bruce W. Colletti" <bcolletti at compuserve.com>
  • Date: Sat, 25 Oct 2003 06:26:37 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

How would I cull integers and squared terms from {3, Sqrt[2], (x+y)^2, x+y^2}?   The desired output is {3, (x+y)^2, y^2}.  Unfortunately:

Cases[{3, Sqrt[2], (x+y)^2, x+y^2}, _Integer | _^2]

returns {3, (x+y)^2} .

Thankx.

Bruce


  • Prev by Date: Re: Integrate piecewise with Assumptions
  • Next by Date: Re: Abort in 5.0
  • Previous by thread: Re: Baffling Failure when plotting multiple curves.
  • Next by thread: Re: Extracting Terms From a List