Table Of Contents

sets_unique

Version:
    Last Modified: March 15, 2017

    Removes repeated instances of input elements.

    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

    Inputs

    a

    Vector or matrix.

    'rows'

    Specifies that c returns the rows that are unique in a.

    Outputs

    c

    Unique elements of a in ascending order. c is a vector or matrix.

    d

    Indexes in a of the elements in c. MathScript 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

    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.

    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')

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: This product does not support FPGA devices


    Recently Viewed Topics