MathGroup Archive 2004

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

Search the Archive

Re: A question about function


In article <cd07ai$9hn$1 at smc.vnet.net>,
 Feng-Yin Chang <fychang at slac.stanford.edu> wrote:

>       For a  variable i(for any data type), I want to define a function
>       like
>       g[i_]:={a[i],b[i],c[i],d[i]....} .
>       (g,a,b,c,d,...are all functions or command)
> 
>       for example
>       g[i]:={Max[i],Min[i]}
> 
>       Is it possible to  gather the list of  function like
>       g[i_]:={a,b,c,d,..}[i] in Mathematica?

Yes. Use Through. For example

  Through[{Max, Min}[{1, 2, 3}]]

Cheers,
Paul

-- 
Paul Abbott                                   Phone: +61 8 9380 2734
School of Physics, M013                         Fax: +61 8 9380 1014
The University of Western Australia      (CRICOS Provider No 00126G)         
35 Stirling Highway
Crawley WA 6009                      mailto:paul at physics.uwa.edu.au 
AUSTRALIA                            http://physics.uwa.edu.au/~paul


  • Prev by Date: Solving the variable system of equations
  • Next by Date: Re: ArcCos[x] with x > 1
  • Previous by thread: Re: A question about function
  • Next by thread: RE: A question about function