File Exchange

image thumbnail

Quantile calculation

version (715 KB) by Christopher Hummersone
Quantiles of a sample via various methods


Updated 05 May 2018

GitHub view license on GitHub

NOTE: this function is now available from the IoSR Matlab Toolbox as iosr.statistics.quantile.
This function calculates quantiles and weighted quantiles for vectors, matrices, or N-D arrays, via one of a number of methods described in

Cite As

Christopher Hummersone (2020). Quantile calculation (, GitHub. Retrieved .

Comments and Ratings (3)


Handy toolset. One suggestion: your "localpeaks" function is a bit crude. Take a look at some of the FE entries which allow for specified minimum peak separation, do curve-fitting, etc.


Migrated to GitHub.

Added weighting option.

Added picture.

Corrected name.

Corrected name.

Minor bug fix when checking P and minor simplification in preallocation of q and N. Added N output to help.

Added traps for sample sizes of 0 or 1.

Added more input checking.

Updated function to return sample size.

MATLAB Release Compatibility
Created with R2014a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Inspired by: Returns weighted percentiles of a sample