A MATLAB function for gridding large datasets of scattered data.
You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
gridbin
A fast MATLAB function for gridding very large datasets of scattered data. This function is somewhat similar to Matlab's built-in griddata or John D'Errico's gridfit, with the differences being that
-
gridbinreturns the mean value of all scattered data points within every cell of a grid rather than interpolating or fitting a surface. -
gridbinis much faster thangriddataorgridfit. -
gridbincan handle much larger scattered datasets thangriddataorgridfit. -
gridbincan return statistics. For example,gridbincan return the standard deviation of all scattered data points within a grid cell simply by adding@stdto the function call.
Syntax
vq = gridbin(x,y,v,xq,yq)
vq = gridbin(...,@func)
[vq,N] = gridbin(...)
Description
vq = gridbin(x,y,v,xq,yq) produces a 2D grid of values vq at the coordinates
xq,yq. Inputs x,y,v may be scattered data, and the output vq is the mean
of all scattered values v within each spatial bin.
vq = gridbin(...,@func) applies any function @func to the v data. By
default, @func is @mean, meaning that vq contains the mean of all values
v within each spatial bin.
[vq,N] = gridbin(...) also returns a grid N containing the number of
observations v in each bin.
Cite As
Chad Greene (2026). gridbin (https://github.com/chadagreene/gridbin), GitHub. Retrieved .
Acknowledgements
Inspired by: Surface Fitting using gridfit
General Information
- Version 1.0.0 (533 KB)
-
View License on GitHub
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
Versions that use the GitHub default branch cannot be downloaded
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.0.0 |

