Re: pure function to generate a list of integrals
- To: mathgroup at smc.vnet.net
- Subject: [mg77084] Re: pure function to generate a list of integrals
- From: chuck009 <dmilioto at comcast.com>
- Date: Sun, 3 Jun 2007 06:07:31 -0400 (EDT)
Probably not what you wanted but this is how I'd do it:
f[x_]:=x^2;
g[fun_,lst_]:=NIntegrate[fun[u],{u,0,#}]&/@lst[[2]];
In[20]:=
list={f,{1,2,3,4}};
g[f,list]
Out[21]=
{0.333333,2.66667,9.,21.3333}