From: Rob on 25 Mar 2010 05:27 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.
From: dh on 25 Mar 2010 07:08 Hi Rob, assuming all your constants are numeric, you could e.g. try: Length(a)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(a)metrohm.com> Internet:<http://www.metrohm.com>
From: Bob Hanlon on 25 Mar 2010 07:09 Variables[(x + y)^2 + 3 z^2 - y z + 7] {x,y,z} % // Length 3 Bob Hanlon ---- Rob <schabertrobbinger(a)gmail.com> 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.
From: David Park on 26 Mar 2010 06:38 ?Variables Then find the length of the list. David Park djmpark(a)comcast.net http://home.comcast.net/~djmpark/ From: Rob [mailto:schabertrobbinger(a)gmail.com] 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.
|
Pages: 1 Prev: estimation Next: How to pass additional parameters to the ticks function? |