MATLAB: Averaging data set in horizontal as well as vertical direction

dominik seifert

suppose we have large no of data..like
1 2 3 4 5 6 7 3 4 5 6 7
3 4 5 6 7 8 3 4 2 4 2 4
1 5 4 2 3 5 4 5 6 5 2 3
1 2 3 4 5 6 7 3 4 5 6 7
3 4 5 6 7 8 3 4 2 4 2 4..
the average in both direction like
1 2 3 4
3 4 5 6
1 5
1 2
average of above set like …so that we can convert 1024*1024 file into 512*512..