matlab按某一列排序


Excel中有按某一列排序,同時擴展到其他列,Matlab中對應的有sortrows:

The MATLAB function sortrows(A,j) sorts the rows of the matrix a based on the entries of the j-th column. For example, enter the following in MATLAB:

A = [1 2 3

    3 0 9

    6 5 4]

B = sortrows(A,2)

C = sortrows(A,3)

You will receive the following output:

B = 3 0 9

  1 2 3

  6 5 4

C = 1 2 3

   6 5 4

   3 0 9

http://kb.iu.edu/data/afrd.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM