Table Of Contents

sortrows

Version:
    Last Modified: March 15, 2017

    Sorts the rows of a matrix.

    Syntax

    c = sortrows(a)
    c = sortrows(a, b)
    [c, d] = sortrows(a)
    [c, d] = sortrows(a, b)

    Inputs

    a

    Matrix with the rows to be sorted.

    b

    Columns of a for sorting the rows. b is a vector of integral numbers.

    Outputs

    c

    Sorted rows of a. Sorts the rows of a in ascending order if elements of b are positive. Sorts the rows of a in descending order if elements of b are negative. MathScript sorts complex vectors by magnitude and angle, in that order. c is a matrix of the same size as a.

    d

    Row indexes in a of the rows in c. d is a vector of integral numbers. The output data type is double precision floating-point number.

    A = [6, 2, 3, 4; 4, 3, 2, 1];
    [C, D] = sortrows(A, [1, 2])

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: This product does not support FPGA devices


    Recently Viewed Topics