Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Sort the matrix corresponding to row

1 回表示 (過去 30 日間)
Bathrinath
Bathrinath 2012 年 2 月 22 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi,
I am new to matlab,can any one help me for sorting the matrix
AA =[2,3,4,5,1,6;21,22,30,36,39,40]
In the matrix AA I want to sort with respect to second row in descending order,so that I can get
AA=[6,1,5,4,3,2;40,39,36,30,22,21]

回答 (1 件)

Sean de Wolski
Sean de Wolski 2012 年 2 月 22 日
sortrows(AA,-2);
and
doc sortrows %for more info

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by