MATLAB: Mean of matrix elements

averageelementsgolfmatrix

hey all. i have a 5760×1 matrix. i need to find the average of the first 10 elements, remove the 10 elements and replave with the averaged number, find the average of the next 10 elements, remove those 10 elements and replace with average and so on…. could anyone give me an insight as to how to do this? much appreciated john

Best Answer

B = mean(reshape(x,10,[]))'
Where x is your original column vector and B is the mean of every 10x1 chunk