B = sortrows(A) sorts the rows of A as a group in ascending order. Argument A must be either a matrix or a column vector.
For strings, this is the familiar dictionary sort. When A is complex, the elements are sorted by magnitude, and, where magnitudes are equal, further sorted by phase angle on the interval .
B = sortrows(A,column) sorts the matrix based on the columns specified in the vector column. If an element of column is positive, MATLAB sorts the corresponding column of matrix A in ascending order; if an element of column is negative, MATLAB sorts the corresponding column in descending order. For example, sortrows(A,[2 -3]) sorts the rows of A first in ascending order for the second column, and then by descending order for the third column.
温馨提示:答案为网友推荐,仅供参考