MathGroup Archive 2013

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

Search the Archive

Re: How to remove external parentheses from a list


On 8/16/13 at 7:06 AM, sy81 at sussex.ac.uk (Samuel Mark Young) wrote:

>I'm looking for an easy way to remove the external parentheses from
>a list.  The list contains integration variables and their
>respective limits, it currently looks something like this:

>{{x1,a,b},{x2,c,d},...,{xn,y,z}}

>However, the Integrate (or NIntegrate function) in Mathematica wants
>me to write it like this:

>{x1,a,b},{x2,c,d},...,{xn,y,z} i.e. The external parentheses have
>been removed

>I've looked around online and seen suggestions for replacing the
>curly brackets "{" with a blank space " ", or using Apply (@@) but
>can't work out the correct syntax.

I assume what you are doing is building a list of of integration
variables and limits. If so, Sequence is the function you want.
You would use it with NIntegrate as follows:

NIntegrate[expressio,
Sequence@@{{x1,a,b},{x2,c,d},...,{xn,y,z}}, options]




  • Prev by Date: Suggestions Bar Hanging
  • Next by Date: Re: fyi, making animation into PDF file from images genenerated by Mathematica
  • Previous by thread: Re: How to remove external parentheses from a list
  • Next by thread: Re: How to remove external parentheses from a list