慕的地10843
sortrows的第二个参数可以指定按哪一列排序。1234567SORTROWS(X,COL) sorts the matrix based on the columns specified in the vector COL. If an element of COL is positive, the corresponding column in X will be sorted in ascending order; if an element of COL is negative, the corresponding column in X will be sorted in descending order. For example, SORTROWS(X,[2 -3]) sorts the rows of X first in ascending order for the second column, and then by descending order for the third column.所以,对应的代码是:1sortrows(A, 1)