Octave has a limited set of functions for managing sets of data, where a set is defined as a collection unique elements.

__Function File:__**create_set***(*`x`)-
Given a matrix or vector of values, the function
`create_set`

returns a row vector containing unique values, sorted in ascending order. For example,create_set ([ 1, 2; 3, 4; 4, 2 ])

returns the vector

[ 1, 2, 3, 4 ]

__Function File:__**union***(*`x`,`y`)-
Return the set of elements that are in either of the sets
`x`and`y`. For example,union ([ 1, 2, 3 ], [ 2, 3, 5 ])

returns the vector

[ 1, 2, 5 ]

__Function File:__**intersection***(*`x`,`y`)-
Return the set of elements that are in both sets
`x`and`y`.

__Function File:__**complement***(*`x`,`y`)-
Returns the elements of set
`y`that are not in set`x`. For example,complement ([ 1, 2, 3 ], [ 2, 3, 5 ])

returns the value

``5'`.

Go to the first, previous, next, last section, table of contents.