Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Map over consequetive list elements' topicStudent Support Forum > General > "Map over consequetive list elements"

< Previous CommentHelp | Reply To Comment | Reply To Topic
Author Comment/Response
Bill Simpson
11/02/12 1:34pm

In[3]:= g[f_,v_]:=Map[f@@#&,Partition[v,3,1]];
g[f,{a,b,c,d,e}]

Out[4]= {f[a,b,c],f[b,c,d],f[c,d,e]}

OR

In[5]:= g[f_,v_]:=Map[Apply[f,#]&,Partition[v,3,1]];
g[f,{a,b,c,d,e}]

Out[6]= {f[a,b,c],f[b,c,d],f[c,d,e]}

URL: ,

Subject (listing for 'Map over consequetive list elements')
Author Date Posted
Map over consequetive list elements Chris Roth 11/01/12 5:19pm
Re: Map over consequetive list elements Bill Simpson 11/02/12 1:34pm
< Previous CommentHelp | Reply To Comment | Reply To Topic