Sorting 1 column with repect to other column....

2 ビュー (過去 30 日間)
inzamam shoukat
inzamam shoukat 2019 年 1 月 17 日
回答済み: madhan ravi 2019 年 1 月 17 日
1.0000 56.6260
2.0000 88.6820
3.0000 84.2882
4.0000 93.1880
5.0000 111.9330
6.0000 95.1210
7.0000 124.4126
8.0000 107.7010
9.0000 110.1771
10.0000 137.8133
I want to sort 1 column with repect to Second column....

回答 (1 件)

madhan ravi
madhan ravi 2019 年 1 月 17 日
a=[ 1.0000 56.6260
2.0000 88.6820
3.0000 84.2882
4.0000 93.1880
5.0000 111.9330
6.0000 95.1210
7.0000 124.4126
8.0000 107.7010
9.0000 110.1771
10.0000 137.8133];
[~,I]=sort(a(:,2));
a(I,:) % sorts second column and arranges first column according to second cloumn

カテゴリ

Help Center および File ExchangeShifting and Sorting Matrices についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by