Mean value of each cell of 2D grid
5 views (last 30 days)
Show older comments
darshan ravoori
on 1 Mar 2019
Commented: Iris Kiebert
on 16 Dec 2019
Hi I am trying to solve a problem that has x,y data and f(x,y). It's a 2D temp map with f(x,y) being temperature values.
I have too many x (3000 values) and y (3000) values and f(x,y) (3000) values.
When I plot surface 2D it generates very odd map with too much of data. To avoid that I am looking to reduce the number of grid points by taking some avg. This way I can reduce the number of grid points.
Can any one has suggestions how to do matlab code for this?
Accepted Answer
Mark Sherstan
on 1 Mar 2019
Look at Jan's answer here. He provides MATLAB code and a refernce to the File Exchange. For your convienance:
X = rand(20, 30);
R = reshape(X, 2, 10, 2, 15);
S = sum(sum(R, 1), 3) * 0.25;
Y = reshape(S, 10, 15);
More Answers (0)
See Also
Categories
Find more on Data Distribution Plots 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!