Elements relation on a matrice? Basic

4 ビュー (過去 30 日間)
Renato de Sá
Renato de Sá 2011 年 2 月 8 日
Hello,
Is it possible to relate elements on a matrice? For exemple:
A = [20 1; 180 2; 135 3; 80 4]
If I want to sort the elements from the first collumn without changing its second collumn corresponding, is it possible?
I want it to end like:
B = [20 1; 80 4; 135 3; 180 2]
Thanks

採用された回答

Sean de Wolski
Sean de Wolski 2011 年 2 月 8 日
doc sortrows
for this case
sortrows(A,[1 2])
  1 件のコメント
Renato de Sá
Renato de Sá 2011 年 2 月 8 日
thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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