mode
Compute mode values.
Syntax
m=mode(x)
m=mode(x,dim)
[m,f,c]=mode(...)
Inputs
- x
- Data sample.
- dim
- Dimension on which to perform the calculation.
Outputs
- m
- The mode values. When multiple modes occur, the lowest value is reported.
- f
- The frequency of the mode values.
- c
- The values that occur at the maximum frequency.
Example
a = [2, 5, 6, 7, 10, 7, 6, 7, 6];
[m,f,c] = mode(a)
m = 6
f = 3
c =
{
[1,1] [Matrix] 2 x 1
6
7
}