Re: Conversion Function -> List
- To: mathgroup at smc.vnet.net
- Subject: [mg44734] Re: Conversion Function -> List
- From: bobhanlon at aol.com (Bob Hanlon)
- Date: Mon, 24 Nov 2003 00:05:21 -0500 (EST)
- References: <bpn3e7$ljo$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Here are a few ways
(List@@#)& /@ (List @@ expr)
expr /. {Plus->List, Times->List}
Cases[expr, (f_)[x__] -> {x}]
Bob Hanlon
In article <bpn3e7$ljo$1 at smc.vnet.net>, zelenkov at mail333.com (Vadim Zelenkov)
wrote:
<< 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?