UNPKG

721 BMarkdownView Raw
1<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
2
3# Function setDistinct
4
5Collect the distinct elements of a multiset.
6A multi-dimension array will be converted to a single-dimension array before the operation.
7
8
9## Syntax
10
11```js
12math.setDistinct(set)
13```
14
15### Parameters
16
17Parameter | Type | Description
18--------- | ---- | -----------
19`a` | Array &#124; Matrix | A multiset
20
21### Returns
22
23Type | Description
24---- | -----------
25Array &#124; Matrix | A set containing the distinc elements of the multiset
26
27
28## Examples
29
30```js
31math.setDistinct([1, 1, 1, 2, 2, 3]) // returns [1, 2, 3]
32```
33
34
35## See also
36
37[setMultiplicity](setMultiplicity.md)