Re: troubles with lists
- To: mathgroup at smc.vnet.net
- Subject: [mg35662] Re: [mg35653] troubles with lists
- From: BobHanlon at aol.com
- Date: Thu, 25 Jul 2002 04:45:48 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 7/24/02 2:48:14 AM, e9426270 at stud4.tuwien.ac.at writes:
>I need to create the following list:
>
>{{equation1, equation2,...equation_n},{x1,x1_0},{x2,x2_0},...{xn,xn_0}}
>
>
>In[48]:= Append[{{equation1, equation2}}, List[{x1, x1_0}, {x2, x2_0}]]
>Out[48]= {{equation1, equation2}, {{x1, 0}, {x2, 0}}}
>
>doesn't give the desired result which is
>
>Out[]= {{equation1, equation2}, {x1, x1_0}, {x2, x2_0}}
>without the brackets.
>
>Has somebody an elegant solution for this problem?
>
n=3;
{Table[ToExpression["equation"<>ToString[k]], {k,n}],
Sequence@@Table[{ToExpression["x"<>ToString[k]],
"x"<>ToString[k]<>"_0"}, {k,n}]}
{{equation1,equation2,equation3},{x1,x1_0},{x2,x2_0},{x3,x3_0}}
Bob Hanlon
Chantilly, VA USA