Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

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




  • Prev by Date: Re: padding numbers in front of uniquely generatd names
  • Next by Date: Re: SetPrecision - What does in find?
  • Previous by thread: Re: Removing brakets of a list
  • Next by thread: Home Page of Marek Rychlik--> Mathematica creations