MATLAB: Mean of row with column shifted

circshiftmeans

i want to find the mean of each row but with the 4th and 5th column shifted down one
Is there anyway of doing this?

Best Answer

mean( [YourArray(:,1:3), circshift(YourArray(:,4:5),1), YourArray(:,6:end)], 2)