MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   在MATLAB中对矩阵排序时如何维护行? (https://www.labfans.com/bbs/showthread.php?t=23479)

poster 2019-12-10 20:41

在MATLAB中对矩阵排序时如何维护行?
 
我有一个2×3矩阵,我想根据第一列对其进行排序。这是一个例子:

data will change to --> new data 11 33 10 22 22 44 11 33 10 22 22 44 我有以下代码可以对矩阵A进行排序,但效果不佳:

sort(A,1,'ascend');

[B]回答:[/B]

[URL="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/sortrows.html"]SORTROWS[/URL]函数可以为您处理:

B = sortrows(A);

[url=https://stackoverflow.com/questions/2923118]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 01:09

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.