How to rearrange row of a matrix based on column value

2 ビュー (過去 30 日間)
sazzad hossen
sazzad hossen 2017 年 8 月 2 日
コメント済み: sazzad hossen 2017 年 8 月 2 日
I have a matrix v=[1 1 7 35; 2 1 27 55; 3 1 5 50] I would like to rearrange the based on the the 4th column maximum value in chronological order new matrix will be like v=[2 1 27 55; 3 1 5 50; 1 1 7 35]

採用された回答

Image Analyst
Image Analyst 2017 年 8 月 2 日
Try this:
[~, sortOrder] = sort(v(:,4), 'descend')
v2 = v(sortOrder,:)
  1 件のコメント
sazzad hossen
sazzad hossen 2017 年 8 月 2 日
Thanks for your response

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeElementary Math についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by