1.8K Downloads
Updated
6 Aug 2007
No License
Calculates the statistical mode (the most frequently occurring element) in a vector (or matrix), and returns the mode, the number of occurrences and the indices of the mode in the vector. Like the build in mode, only also includes indices.
Reasonable fast :-)
If more than one mode exist (2+ elements with equal maximum occurances) first one found is returned.
Plz comment or leave feedback
Cite As
Felix Hebeler (2026). Modal (https://uk.mathworks.com/matlabcentral/fileexchange/15754-modal), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2006b
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Data Distribution Plots in Help Center and MATLAB Answers
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 | - Correct a bug where output was NaN if first cell in input grid are NaN and most cells in grid are NaN |
