Prev: ** DECEMBER DISCOUNT: A WorkLife FrameWork....
Next: Finding how to do things by trial and error
From: Faysal Aberkane on 5 Dec 2009 05:32 I think this function can be particularly useful : FoldListN[f_,x_,l_] := FoldList[f[#1,Sequence@@#2]&,x,Transpose[l]] Example : l1 = {a,b,c}; l2 = {1,2,3}; l3 = {=80,=B2,=FF}; l4={X,Y,Z}; FoldListN[f,x,{l1,l2,l3,l4}] output : {x,f[x,4,1,=80,X],f[f[x,4,1,=80,X],b,2,=B2,Y],f[f[f[x,4,1,=80,X],b,2,=B2,Y],c, 3,=FF,Z]}
|
Pages: 1 Prev: ** DECEMBER DISCOUNT: A WorkLife FrameWork.... Next: Finding how to do things by trial and error |