Re: counting number of variables in an expression
- To: mathgroup at smc.vnet.net
- Subject: [mg108634] Re: counting number of variables in an expression
- From: dh <dh at metrohm.com>
- Date: Thu, 25 Mar 2010 06:08:35 -0500 (EST)
- References: <hofa9a$4r4$1@smc.vnet.net>
Hi Rob, assuming all your constants are numeric, you could e.g. try: Length@Union@Cases[Sin[x1 + x2] x3 + x1^3, _Symbol, Infinity] Daniel On 25.03.2010 10:27, Rob wrote: > Is there a straightforward way to count the number of variables in an > expression? If it makes any difference what I'm looking at is the > product of several polynomials in many variables with rational > coefficients. > -- Daniel Huber Metrohm Ltd. Oberdorfstr. 68 CH-9100 Herisau Tel. +41 71 353 8585, Fax +41 71 353 8907 E-Mail:<mailto:dh at metrohm.com> Internet:<http://www.metrohm.com>