Table Of Contents

sets_diff

Version:
    Last Modified: March 15, 2017

    Returns the elements of the first input that are not in the second input.

    Syntax

    c = sets_diff(a, b)
    c = sets_diff(a, b, 'rows')
    c = sets_diff(a, b, order)
    c = sets_diff(a, b, 'rows', order)
    [c, d] = sets_diff(a, b)
    [c, d] = sets_diff(a, b, 'rows')
    [c, d] = sets_diff(a, b, order)
    [c, d] = sets_diff(a, b, 'rows', order)
    Legacy name: setdiff

    Inputs

    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 in a that are not in b. You can specify this input when a and b are arrays 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.

    Outputs

    c

    Elements in a that are not in b. c is a vector or matrix. If a is a row vector, c will be a row vector, otherwise, c will be 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.

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

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: This product does not support FPGA devices


    Recently Viewed Topics