I have a file with the data: x-coordinate, y-coordinate, and f(x,y). For example: 2.33124, 5.90821, 453.009374 .
I would like to use a 2-d square grid with a mesh of, say 50 x 50 boxes to find the average of the f(x,y) values that lie within each box of the grid. I need to then store the average of each box with the box's coordinates on the grid i.e., (1,1),(1,2),(1,3)...(2,1),(2,2)...into the elements of a 2d array.
Are there any functions in matlab which can be used to do this? How can I use Matlab to find out which (x,y) pairs are within which boxes of the grid? What I want to do is simple, but I'm just not sure where to begin.