# sets_unique (MathScript RT Module Function)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info

Owning Class: sets

Requires: MathScript RT Module

## Syntax

c = sets_unique(a)

c = sets_unique(a, 'rows')

[c, d, e] = sets_unique(a)

[c, d, e] = sets_unique(a, 'rows')

Legacy Name: `unique`

## Description

Removes repeated instances of input elements.

Examples

## Inputs

Name Description
a Specifies a vector or matrix.
'rows' Specifies that c returns the rows that are unique in a.

## Outputs

Name Description
c Returns in ascending order the unique elements of a. c is a vector or matrix.
d Returns the indexes in a of the elements in c. LabVIEW uses the index of the last occurrence of each unique element in a. If a is a matrix and you specify 'rows', d returns the row index in a of the rows in c. d is a vector of integers.
e Returns the indexes in c of the elements in a. If a is a matrix, e returns the row index in c of the rows in a. e is a vector of integers.

## Details

The following table lists the support characteristics of this function.

 Supported in the LabVIEW Run-Time Engine Yes Supported on RT targets Yes Suitable for bounded execution times on RT Not characterized

## Examples

A = [1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
C = sets_unique(A)

A = [1, 2, 3; 4, 5, 6; 1, 2, 3]
[C, D, E] = sets_unique(A, 'rows')