I have a vector of values that I would like to report the average in windows along a smaller slide.
For example, for a vector of the following values:
4, 5, 7, 3, 9, 8
A window size of 3 and a slide of 2 would do the following:
(4+5+7)/3 = 5.33
(7+3+9)/3 = 6.33
(9+8)/3 = 5.67
And return a vector of these values:
5.33, 6.33, 5.67
Is there a simple function that will do this for me? If it also returned the indices of the window starts that would be an added bonus. In this example that would be 1,3,5