MathGroup Archive 2003

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

Search the Archive

Re: Conversion Function -> List


How's this?

rule = {Times -> List, Plus -> List};
x y + Sin[x] Cos[y] /. rule

{{x, y}, {Cos[y], Sin[x]}}

Sum[p[i, x] q[i[y]], {i, 1, 10}] /. rule

{{p[1, x], q[1[y]]}, {p[2, x], q[2[y]]}, {
  p[3, x], q[3[y]]}, {p[4, x], q[4[y]]}, {
  p[5, x], q[5[y]]}, {p[6, x], q[6[y]]}, {
  p[7, x], q[7[y]]}, {p[8, x], q[8[y]]}, {
  p[9, x], q[9[y]]}, {p[10, x], q[10[y]]}}

Bobby

zelenkov at mail333.com (Vadim Zelenkov) wrote in message news:<bpn3e7$ljo$1 at smc.vnet.net>...
> Hello!
> 
> Given a function
>     x y + Sin[x] Cos[y]
> 
> I need to convert it into the list
>     {{x,y},{Sin[x],Cos[x]}}
> 
> Generally, the purpose to convert a function
>     Sum[p[i,x] q[i[y], {i,1,n}]
> 
> into the list
>     {{p[1,x],q[1,y]},...,{p[n,x],q[n,y]}
> 
> How to do it using Mathematica?
> 
> Thanks in advance!
> 
> V.Z.
> 
> P.S, If possible please duplicate your answers to zelenkov[at]mail333.com


  • Prev by Date: is there a Linux-dyn version of mathlm?
  • Next by Date: RE: Conversion Function -> List
  • Previous by thread: Re: Conversion Function -> List
  • Next by thread: RE: Conversion Function -> List