MathGroup Archive 2009

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

Search the Archive

Re: setting discrete values for a function -- newbie


Scan[(f[#] = 0) &, {a, b, c}]

Cheers -- Sjoerd

On Mar 16, 1:28 pm, "Karsten W." <Karsten.G.Wein... at googlemail.com>
wrote:
> Hello,
>
> my task is to set some function values f[[a], f[b], ... to zero. Is
> there a nicer way to do this than this one:
>
> Clear[f];
> args = Partition[{a,b,c}, 1];
> Apply[(f[#] = 0 )&, args, {1}];
>
> Especially, can I avoid calling Partition?
>
> Best wishes,
> Karsten.



  • Prev by Date: Re: setting discrete values for a function -- newbie
  • Next by Date: how to make arrays from text file in mathematica??
  • Previous by thread: Re: setting discrete values for a function -- newbie
  • Next by thread: Re: setting discrete values for a function -- newbie