MATLAB: How to the average of specific subsets on a matrix

meanselection matrix subsets

I have a matrix 96×1 and I want to do the average of the first 3 values, and then the average of the next 3 and so on until the end.

Best Answer

>> M = rand(96,1); % your data matrix
>> mean(reshape(M,3,[]),1)