MATLAB Function Reference
  Go to function:
    Search    Help Desk 
unique    Examples   See Also

Unique elements of a vector

Syntax

Description

b = unique(a) returns the same values as in a but with no repetitions. The resulting vector is sorted in ascending order. a can be a cell array of strings.

b = unique(A,'rows') returns the unique rows of A.

[b,i,j] = unique(...) also returns index vectors i and j such that b = a(i) and a = b(j) (or b = a(i,:) and a = b(j,:)).

Examples

See Also

intersect, ismember, setdiff, setxor, union



[ Previous | Help Desk | Next ]