# unique(a)

Returns unique subset.

### Syntax

o_unique(a)
  a: array any - input set
  return: array 1D any - array with all duplicated elements removed

### Usage

Use this to remove duplicate elements in an array.

### Location

menu: veeos ==> Math ==> Sets ==> unique

library: mathLib

### Example

o_unique( [2 3 4 3 5 5 3 1] ) returns [2 4 5 3 1]

### Notes

When dealing with sets it is often useful to remove duplicate entries. A typical case is when processing all elements individually and not wanting to perform the processing twice for a duplicated element. Note that in the case of duplicates, the last identical element is retained.

### Reference

### Dependencies

use isElement(set,element)

### Supported On

VEE 7.0+, all platforms

### See Also

isElement, setAND, setComplement, setOR, setXOR

© 2015-2017. All Rights Reserved. Stan Bischof (stan@worldbadminton.com). Last updated 24 February 2017 09:07.