RE: Removing brakets of a list
- To: mathgroup at smc.vnet.net
- Subject: [mg48293] RE: [mg48288] Removing brakets of a list
- From: "David Park" <djmp at earthlink.net>
- Date: Sat, 22 May 2004 03:04:24 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Sebastian,
How do you intend to use the output? It is not proper Mathematica syntax
standing alone.
expr = Flatten[Table[Subscript[x, i, j],
{i, 1, 4}, {j, 1, 4}]];
You can insert the arguments in another function f by
f @@ expr
You can insert the list as arguments with other arguments by
f[a, b, Sequence @@ expr]
You could display them with a Print statement by
{#, ", "} & /@ expr // Flatten // Drop[#, -1] &
Print @@ %
David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/
From: Sebastian Cohen S [mailto:scohen at cable.net.co]
To: mathgroup at smc.vnet.net
Hello everyone in the group,
I need to know a way to remove the outer brakets that encapsulate a
list generated by the Table function.
i.e:
Flatten[Table[Subscript[x, i, j],
{i, 1, 4}, {j, 1, 4}]]
Generates:
{Subscript[x, 1, 1], Subscript[x, 1, 2], <<12>> Subscript[x, 4, 3],
Subscript[x, 4, 4]}
And I need a function that flattens the output completely removing the
outer brakets like giving the following as an output:
Subscript[x, 1, 1], Subscript[x, 1, 2], <<12>> Subscript[x, 4, 3],
Subscript[x, 4, 4]
Has anyone done it? or know how to do it?
Thanks in advance for any help you may provide,
Sebastian Cohen S