mathjs
Version:
Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with dif
38 lines (22 loc) • 721 B
Markdown
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
# Function setDistinct
Collect the distinct elements of a multiset.
A multi-dimension array will be converted to a single-dimension array before the operation.
## Syntax
```js
math.setDistinct(set)
```
### Parameters
Parameter | Type | Description
--------- | ---- | -----------
`a` | Array | Matrix | A multiset
### Returns
Type | Description
---- | -----------
Array | Matrix | A set containing the distinc elements of the multiset
## Examples
```js
math.setDistinct([1, 1, 1, 2, 2, 3]) // returns [1, 2, 3]
```
## See also
[setMultiplicity](setMultiplicity.md)