Table Of Contents

flatindex

Version:
    Last Modified: March 15, 2017

    Computes the linear position of pairs of a matrix.

    Syntax

    c = flatindex(size, a1, a2, ..., an)
    Legacy name: sub2ind

    Inputs

    size

    Size of an array of any dimension. size is a vector of integers.

    a1

    Index of the corresponding dimension. a1 is an array of the same size as a2, a3, and so on.

    a2

    Index of the corresponding dimension. a2 is an array of the same size as a1, a3, and so on.

    ...

    Further arrays.

    an

    Index of the corresponding dimension. an is an array of the same size as a1, a2, and so on.

    Outputs

    c

    Linear position of all pairs (a1, a2, ..., an) of an array of any dimension with the specified size. c is a matrix of the same size as a.

    A = [1, 2, 3]
    B = [1, 2, 3]
    SIZE = [3, 3]
    C = flatindex(SIZE, A, B)

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: This product does not support FPGA devices


    Recently Viewed Topics