Descriptive Statistics
This function gets the key values for a descriptive statistics such as mean, std, mode, median, quartiles and percentiles. This includes the five- and seven-number summary.
Input x must be a vector or a matrix where each column of x is regarded as a data set if x is a matrix. Input param is an optional cell list of parameters, e.g., param = {'whisker', 2} setting whisker = 2. Multiple user defined options are separated by semi-colon, e.g., param = {'whisker', 2; 'qmethod','-mean'}.
Output ds is a structure. To extract the quartiles for instance quart = ds.quartile.
Examples:
ds = getDescriptiveStatistics(randn(1000,10))
ds = getDescriptiveStatistics(rand(1000,2),{'whisker', 2; 'qmethod','-mean'})
ds = getDescriptiveStatistics(rand(1000,2),{'percent', [25 50 75];'pmethod','nearestRank'})
Cite As
Matthias Chung (2026). Descriptive Statistics (https://uk.mathworks.com/matlabcentral/fileexchange/29305-descriptive-statistics), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- AI and Statistics > Statistics and Machine Learning Toolbox > Descriptive Statistics and Visualization >
Tags
Acknowledgements
Inspired: summarize
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
