UNPKG

990 BMarkdownView Raw
1<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
2
3# Function mode
4
5Computes the mode of a set of numbers or a list with values(numbers or characters).
6If there are more than one modes, it returns a list of those values.
7
8
9## Syntax
10
11```js
12math.mode(a, b, c, ...)
13math.mode(A)
14```
15
16### Parameters
17
18Parameter | Type | Description
19--------- | ---- | -----------
20`args` | ... * | A single matrix
21
22### Returns
23
24Type | Description
25---- | -----------
26* | The mode of all values
27
28
29## Examples
30
31```js
32math.mode(2, 1, 4, 3, 1) // returns [1]
33math.mode([1, 2.7, 3.2, 4, 2.7]) // returns [2.7]
34math.mode(1, 4, 6, 1, 6) // returns [1, 6]
35math.mode('a','a','b','c') // returns ["a"]
36math.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)