Coded in Python
Let u be a one dimensional array. Construct another array \zeta with values
\zeta _(i)=(u_(i)+u_(i+1)+u_(i+2))/(3)
In statistics, this array is called the moving average of u. In approximation theory, it plays the role as the Greville abscissae of cubic splines. Try to avoid the use of for loops in your script.
Demonstrate your code using a u as
1,5,43,2,5,3,6,7,2,1,4,5,6,3,4,2,9,10,11,22
plot u and \zeta in the same figure.
Hint: hstack