![]() |
[求助]关于matlab排序的问题!
我知道能用 sort排一个矩阵的序,但是只能是对某一列,我现在想按其中一列排序,然后其他的列与排序 的列的相对位置不变,怎么半啊???有没这样的命令??没有该怎么做呢??
比如要对【2,3,1;4,5,6】按第一列排序后是【1,2,3;6,4,5】 谢谢大家啊!! |
回复: 求助!急啊!关于matlab排序的问题!
很简单,你复制代码运行下:
[CODE]a=[2,3,1;4,5,6]; [b,pos]=sort(a(1,:)); a=a(:,pos); a[/CODE] |
回复: [求助]matlab多项式的问题
不胜感激!!!:redface:
|
回复: [求助]关于matlab排序的问题!
我也学习了!
|
回复: [求助]关于matlab排序的问题!
[SIZE="5"]用sortrows函数,自己看帮助,
B = sortrows(A,column) sorts the matrix based on the columns specified in the vector column. If an element of column is positive, the MATLAB? software 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.[/SIZE] |
所有时间均为北京时间。现在的时间是 03:18。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.