I have a list and an arbitrary function with 4 parameters, say {1, 11, 3, 13, 9, 0, 12, 7}and f[{x,y,z,w}]={x+y, z+w}. I want to do this in order to form a new list, so that 4 consecutive elements in the original list are evaluated to get a new value as a new component of the list, and the evaluation must be performed at every 2 positions in the original list, in this case the resulting list:
{{12, 16}, {16, 9}, {9, 19}}
Note here 4 and 2 are subject to change. How to do it in Mathematica? I imagine this as something like Map, but not sure how to relate.
source
share