Re: setting discrete values for a function -- newbie
- To: mathgroup at smc.vnet.net
- Subject: [mg97637] Re: setting discrete values for a function -- newbie
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Tue, 17 Mar 2009 05:02:21 -0500 (EST)
On 3/16/09 at 6:28 AM, Karsten.G.Weinert at googlemail.com (Karsten W.) wrote: >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? In[30]:= Clear[f]; Set[f[#], 0] & /@ {a, b, c}; f[a] Out[32]= 0