MathGroup Archive 2008

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

Search the Archive

Re: How to separate a sum into terms



Hi Slaa,

you need simply to change the Head "Plus" of the expression to "List", 

using e.g. Apply:

List@@ expression

hope this helps, Daniel



Slava Rychkov wrote:

> Hi!

> 

> I want to separate a Mathematica expression written as a sum into 

> separate terms

> E.g. for

> 

> a+b-c+f[1]-g[a]/g[b]

> 

> I want to get a list

> 

> {a,b,-c,f[1],-g[a]/g[b]}

> 

> Is there a simple way to do this?

> 

> Thanks,





-- 



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>




  • Prev by Date: Re: Variable names in Mathematica
  • Next by Date: Re: Variable names in Mathematica
  • Previous by thread: Re: How to separate a sum into terms
  • Next by thread: bug... GraphicsGrid ItemAspectRatio Spacings