# sets_union

Version:

Returns the elements that are in at least one of the inputs.

## Syntax

c = sets_union(a, b)
c = sets_union(a, b, 'rows')
c = sets_union(a, b, order)
c = sets_union(a, b, 'rows', order)
[c, d, e] = sets_union(a, b)
[c, d, e] = sets_union(a, b, 'rows')
[c, d, e] = sets_union(a, b, order)
[c, d, e] = sets_union(a, b, 'rows', order)
Legacy name: union

## a

Array of any dimensions. a should be the same class as b or double.

## b

Array of any dimensions. b should be the same class as a or double.

## 'rows'

If used, c returns the rows that are in a or b. You can specify this input when a and b are matrices with the same number of columns.

## order

Indicates whether the output should be sorted. order is a string that accepts the following values.

Name Description
'sorted' (default)

Sorts the output.

' stable'

Does not sort the output.

## c

Elements that are in a or b. If a contains repeated elements that also are in b, c contains as many of those repeated elements as are in a. c is a vector or matrix. If a is a row vector, c is a row vector, otherwise, c is a column vector. The output data type is not the greater data type of the two inputs. For example, if one input is double precision and the other input is single precision floating point number, the output is a single type.

## d

Indexes in a of the elements in c. d is a vector of doubles.

## e

Indexes in b of the elements in c. e is a vector of doubles.

A = [1, 2, 3, 4, 5, 6, 7, 8, 9]
B = [2, 3, 5, 7]
[C, I] = sets_union(A, B)

Where This Node Can Run:

Desktop OS: Windows

FPGA: This product does not support FPGA devices