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