Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

unique (MathScript Function) (Windows, Not in Base Package)

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Member of the sets class.

Syntax

c = unique(a)

c = unique(a, 'rows')

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

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

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.

Examples

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

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

Related Topics

intersect
ismember
setdiff
setxor
union


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit