MathGroup Archive 2002

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

Search the Archive

Re: How build a ?TestFuntion that applied to a list gives only the elements that are function of x


At 01:38 AM 2/23/2002, J. Guillermo Sanchez wrote:

>How build a ?TestFuntion that applied to a list give only the elements
>that are function of x
>
>Example:
>
>In[]:= {Sin[a x], b x, t, c r}/.?TestFuntion
>
>gives
>
>Out[] = {Sin[a x], b x}
>
>Thanks
>
>Guillermo Sanchez

TestFuntion[expr_] := !FreeQ[expr, x]

Then

Select[{Sin[a x], b x, t, c r}, TestFuntion]

or

Cases[{Sin[a x], b x, t, c r}, _?TestFuntion]

--------------------------------------------------------------
Omega Consulting
"The final answer to your Mathematica needs"

Spend less time searching and more time finding.
http://www.wz.com/internet/Mathematica.html



  • Prev by Date: Re: How build a ?TestFuntion that applied to a list gives only the elements that are function of x
  • Next by Date: scatter3Dplot_movie
  • Previous by thread: RE: How build a ?TestFuntion that applied to a list gives only the elements that are function of x
  • Next by thread: Suppression of output...