Re: What variables are in a function and displaying surds
- To: mathgroup at smc.vnet.net
- Subject: [mg31123] Re: [mg31117] What variables are in a function and displaying surds
- From: BobHanlon at aol.com
- Date: Fri, 12 Oct 2001 03:36:40 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 2001/10/10 7:58:27 PM, michael_r_went at yahoo.com writes: >Is there a way in Mathematica to generate a list of variables in an >expression like Variable[]. For example if I passed the expression >Sin[x+y]+ z/p - t the list {x,y,z,p,t} would be generated. > expr=Sin[x+y]+z/p-t+Pi-E; Cases[expr, _Symbol, Infinity] {E, Pi, t, p, z, x, y} Note that Pi and E are symbols. To exclude numeric symbols: Cases[expr, _Symbol?(!NumericQ[#]&), Infinity] {t, p, z, x, y} Bob Hanlon Chantilly, VA USA