Table Of Contents

sets_intersect

Version:
    Last Modified: March 15, 2017

    Computes the intersection of sets.

    Syntax

    c = sets_intersect(a, b)
    c = sets_intersect(a, b, 'rows')
    [c, d, e] = sets_intersect(a, b)
    [c, d, e] = sets_intersect(a, b, 'rows')
    Legacy name: intersect

    Inputs

    a

    Vector or matrix.

    b

    Vector or matrix.

    'rows'

    Specifies that c returns the rows that are in both a and b if a and b are matrices with the same number of columns.

    Outputs

    c

    All the elements in both a and b in ascending order. c is a vector or matrix.

    d

    Indexes of the elements in a that are in c. d is a vector of integers.

    e

    Indexes of the elements in b that are in c. e is a vector of integers.

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

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: This product does not support FPGA devices


    Recently Viewed Topics