Creating a grid where means can be calculated in each cell and then each grid cell coloured accordingly.

2 views (last 30 days)
I'm organizing data (x and y coordinates and a third value associated with each point). I'm able to plot everything and capture frames as the particles and create videos of their motion. Now I'm trying to create a grid where the third values in each cell are summed and then averaged. Then the grid cell should be coloured according to the mean value of the third value in the cell. Here's my code: I've made it up to the point where I can get the mean volume in each cell, but I'm not sure how to implement the colouring of the cells now. I'm using a fine grid and thousands of data points.
Any advice would be appreciated. Also, if you have suggestions on making my code better, or a better existing function, that would be great. Thanks.
Code: https://www.dropbox.com/s/qxwsfz1i7ebdp53/grd.m?dl=0

Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!