1 |
|
2 |
|
3 | # Function mode
|
4 |
|
5 | Computes the mode of a set of numbers or a list with values(numbers or characters).
|
6 | If there are more than one modes, it returns a list of those values.
|
7 |
|
8 |
|
9 | ## Syntax
|
10 |
|
11 | ```js
|
12 | math.mode(a, b, c, ...)
|
13 | math.mode(A)
|
14 | ```
|
15 |
|
16 | ### Parameters
|
17 |
|
18 | Parameter | Type | Description
|
19 | --------- | ---- | -----------
|
20 | `args` | ... * | A single matrix
|
21 |
|
22 | ### Returns
|
23 |
|
24 | Type | Description
|
25 | ---- | -----------
|
26 | * | The mode of all values
|
27 |
|
28 |
|
29 | ## Examples
|
30 |
|
31 | ```js
|
32 | math.mode(2, 1, 4, 3, 1) // returns [1]
|
33 | math.mode([1, 2.7, 3.2, 4, 2.7]) // returns [2.7]
|
34 | math.mode(1, 4, 6, 1, 6) // returns [1, 6]
|
35 | math.mode('a','a','b','c') // returns ["a"]
|
36 | math.mode(1, 1.5, 'abc') // returns [1, 1.5, "abc"]
|
37 | ```
|
38 |
|
39 |
|
40 | ## See also
|
41 |
|
42 | [median](median.md),
|
43 | [](.md),
|
44 | [mean](mean.md)
|