MATLAB: How to take the mean of each row every third column

extracting the mean skipping columns

Hi all,
This is what I'm trying to do- E is a 65×900 array, and I want to extract from that the mean for each row of every third column-in other words, for rows 1 to 65, I want the mean across each row but only of values in columns 1, 4, 7,10, etc, so that I get a 65×1 vector-how would I do that?
Best regards

Best Answer

mean(yourarray(:, 1:3:end), 2)