How to create average of values within a grid box??
Show older comments
Hello everyone,
I have data which looks like this:
3127 x 254 x 365 which represents the satellite data (index (3127) along arcs (254) for each day of the year).
I want to split this data into grid squares before averaging (see picture at bottom of the page - bottom right picture where the red lines are the satellite arcs). Once I have the data selected into grid squares I will then average all values within each grid square. Does anyone know how I can do this? I'm more after which commands to use. Should I interpolate the data onto a regular grid?
One idea I have is to use areaquad to create the size of the grid squares and then repeat the dimension to create a matrix. However, I don't know how I can then average all values within each square.
Thanks, Michael

Accepted Answer
More Answers (1)
Reema Alhassan
on 4 Jun 2018
0 votes
hello, I'm trying to do this process on geotiff image so in this line : compartmentID = colID + (rowID-1) * nRows ; how could I get the colID and rowID and nRow from the image ? could you explain more please ?
thank you,
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!