You are here: Resources Gateway home > MATLAB grain size utilities
MATLAB functions for the manipulation of grain-size data
This page provides access to various MATLAB® functions to facilitate the analysis and manipulation of grain-size data.
Note that some of the functions require the Statistics Toolbox. More information about MATLAB® is available on The Mathworks website.
If you find these functions useful, or find bugs, please tell us.
- abspsierr2percentmmerr - Convert absolute error in psi units to percent error in mm.
- percentmmerr2abspsierr - Convert percentage error in mm to the absolute error in psi units.
Percentiles and grain-size plots
- prctile2 - Calculate grain-size percentiles for binned data. Suitable for data derived from sieving.
- dgprctile - Calculate percentiles of a sample. This method gives a slightly different result to the PRCTILE function in the MATLAB Statistics Toolbox.
- gbnprctil - Calculate percentiles in grid-by-number form using grain size and exposed surface area (as described in Graham et al. in press). This function will typically be used where data on grain b-axis size and area have been derived from an image (as an alternative to applying a Kellerhals and Bray (1971) conversion).
- cum_prct_gsd - Plot cumulative percent finer grain-size distributions for binned data.
- graphical_stats - Calculate Folk & Ward inclusive graphical statistics.
- moment_stats - Calculate grain-size statistics by the method of moments. Statistics are based on the raw grain measurements and do not rely on binning the data into size classes.
Graham DJ, Rollet A-J, Rice SP & Piégay H. In press. Conversions of surface grain-size samples collected and recorded using different procedures. Journal of Hydraulic Engineering.