mode.md (1042B)
1 <!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. --> 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 ### Throws 30 31 Type | Description 32 ---- | ----------- 33 34 35 ## Examples 36 37 ```js 38 math.mode(2, 1, 4, 3, 1) // returns [1] 39 math.mode([1, 2.7, 3.2, 4, 2.7]) // returns [2.7] 40 math.mode(1, 4, 6, 1, 6) // returns [1, 6] 41 math.mode('a','a','b','c') // returns ["a"] 42 math.mode(1, 1.5, 'abc') // returns [1, 1.5, "abc"] 43 ``` 44 45 46 ## See also 47 48 [median](median.md), 49 [](.md), 50 [mean](mean.md)