MathGroup Archive 2009

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

Search the Archive

Re: Defining function with indexed variables


On May 2, 5:58 am, Paul Smith <phh... at gmail.com> wrote:
> Dear All,
>
> How can one define the function
>
> f(x1,x2,...,x100) := x1^2 + x2^2 + ... + x100^2
>
> using superscripts?
>
> Thanks in advance,
>
> Paul


I didn't really know what you were saying about superscripts, but I
believe this will work

f = Total@List[##]^2 &

and it works for any number of inputs.

Nick.


  • Prev by Date: Re: Defining function with indexed variables
  • Next by Date: Re: Defining function with indexed variables
  • Previous by thread: Re: Defining function with indexed variables
  • Next by thread: Re: Defining function with indexed variables