From: Bill Rowe on 14 May 2010 05:34 On 5/13/10 at 7:25 AM, gigabitbucket(a)BrockEng.com (Fred Klingener) wrote: >This seems to work fine, but there must be a less clumsy way to do >it: >Clear[innerApply, functionList, argumentList, f, g, a, b, c, d] >innerApply[functionList_, argumentList_] := >Table[functionList[[j]] @@ argumentList[[j]], {j, 1, >Length[functionList]}] >In[770]:= innerApply[{f, g}, {{a, b}, {c, d}}] >Out[770]= {f[a, b], g[c, d]} This seems less clumsy to me: In[1]:= MapThread[#1 @@ #2 &, {{f, g}, {{a, b}, {c, d}}}] Out[1]= {f[a, b], g[c, d]} Perhaps someone else will suggest something even more elegant
|
Pages: 1 Prev: Genetic Algorithm Next: innerApply[{f, g}, {{a, b}, {c, d}}] = {f[a, b], g[c, |