movmean is a function in Matlab, detailed here.
It can be used to quickly compute the moving average of a vector. If you have a matrix (collection of vectors), as it is apparant from you question. You can repeat movmean over all the vecotors of a matrix.
You've to use value of k to be 6, as you asked in question. Explore the link to learn more about it.
Feel free to explore Plots, to learn more about 2 and 3 dimensional plots in Matlab.