GNU Octave Manual Version 3by John W. Eaton, David Bateman, Søren Hauberg Paperback (6"x9"), 568 pages ISBN 095461206X RRP £24.95 ($39.95) |

# 25 Sets

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

__Function File:__**create_set***(*`x`)- Return a row vector containing the unique values in
`x`, sorted in ascending order. For example,create_set ([ 1, 2; 3, 4; 4, 2 ]) => [ 1, 2, 3, 4 ]

See also union, intersection, complement

__Function File:__**unique***(*`x`)-
Return the unique elements of

`x`, sorted in ascending order. If`x`is a row vector, return a row vector, but if`x`is a column vector or a matrix return a column vector. __Function File:__**unique***(*`A`, 'rows')-
Return the unique rows of

`A`, sorted in ascending order. __Function File:__[`y`,`i`,`j`] =**unique***(*`x`)-
Return index vectors

`i`and`j`such that`x(i)==y`

and`y(j)==x`

.See also union, intersect, setdiff, setxor, ismember

ISBN 095461206X | GNU Octave Manual Version 3 | See the print edition |