MathGroup Archive 2003

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

Search the Archive

Re: Re: extracting variables from an expression


vars[expr_]:=Union[Cases[expr,_Symbol?(!NumericQ[#]&),Infinity]]


to avoid Pi, E, I etc. to be recognized as variables.

Peter Pein, Berlin
petsie at arcAND.de
replace && by || to write to me


----- Original Message ----- 
From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
To: mathgroup at smc.vnet.net
Subject: [mg44175] [mg44144] Re: extracting variables from an expression


> Hi,
> 
> Cases[x || y || z, _Symbol, Infinity]
> 
> 
> Regards
>   Jens
> 
> Peter Schinko wrote:
> > 
> > Hi,
> > 
> > I'm looking for a function that extracts all variables from a boolean
> > expression.
> > For example:
> > x || y || z
> > should return something similar to {x, y, z}.
> > 
> > Is there a similar function in Mathematica? If so, how does it work?
> > 
> > Thanks very much
> > Peter
>


  • Prev by Date: Re: extracting variables from an expression
  • Next by Date: Problems With Combinatorica -> Graphs
  • Previous by thread: Re: extracting variables from an expression
  • Next by thread: Re: extracting variables from an expression