I have and time sequence: lines are channels, columns are time points, say

```matlab
x = [1 2 3 4 5 6 7 8; 9 10 11 12 13 14 15 16; 17 18 19 20 21 22 23 24 ; 25 26 27 28 29 30 31 32]
x =

    1    2    3    4    5    6    7    8
    9   10   11   12   13   14   15   16
   17   18   19   20   21   22   23   24
   25   26   27   28   29   30   31   32

```

I have an index of a specific points in time when I want to compute mean for the `x`

```matlab
y = [4 5 6]
y =
   4   5   6

```

How can I get a 3D array out of x with +- 2 points around and average thrue 3d dimation? In over words, I need to average

```
 3  4  5           4  5  6       5  6  7
11 12 13   and    12 13 14 and  13 14 15
19 20 21          20 21 22      21 22 23
27 28 29          28 29 39      29 30 31

```

for each entrance.