Re: To apply a function to a List
- To: mathgroup at smc.vnet.net
- Subject: [mg65644] Re: [mg65597] To apply a function to a List
- From: "Christoph Lhotka" <lhotka at astro.univie.ac.at>
- Date: Tue, 11 Apr 2006 04:04:57 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
The answer is:
f/@list
(it's called Map over list)
Apply in Mathematica just means replace head with f (f@@list).
If you want to map on a different level than the first use Map[f,list,level]
chlh
On Mon, 10 Apr 2006 02:31:17 -0400 (EDT)
Francisco Javier <pacoga at ctv.es> wrote:
> Dear all,
>
> Let f, l be a function and a list respectively. How can we do
>
> Table[f[list[[n]]],{n,1, Length[list]}]
>
> in another way?
>
> Thanks.
>
> --
> ----
> Francisco Javier García Capitán
> http://garciacapitan.auna.com
>
-- Mag. Christoph Lhotka --
University of Vienna / Institute for Astronomy
mail. lhotka at astro.univie.ac.at