As you mentioned, the size of the data is "10039 columns, 64 rows"
Load the file using readmatrix or load function.
1. If you have the different rows number & divisible by 30 or step size, you can create a 1D row array easily
An example rows size is 300, in that case it would be
30 30 30 30 30 30 30 30 30 30
2. As the given rows number is not divisible by 30 exactly (64 case), hence I have created rows vector [30 30 4], you can make it generalize
3. If the all cell elements are equal size in cell data, such case you can easiliy avoid the for loop here by data sequzeeing in cat 3 dimention, afterwards apply the mean on individual planes (3rd Dimension).
Hope it Helps!