How to find indices of ranking of element in matrix

5 ビュー (過去 30 日間)
Pradya Panyainkaew
Pradya Panyainkaew 2018 年 2 月 8 日
編集済み: Tomás Nunes 2018 年 3 月 19 日
if i have A=[0 32 103 59 543]; How can I find a ranking indices of each element to get a result like this
Result=[5 4 2 3 1]
Thanks in advance

採用された回答

Birdman
Birdman 2018 年 2 月 8 日
[~,idx]=ismember(A,sort(A,'descend'))
  2 件のコメント
Pradya Panyainkaew
Pradya Panyainkaew 2018 年 2 月 8 日
Thank you so much Birdman.
Tomás Nunes
Tomás Nunes 2018 年 3 月 19 日
編集済み: Tomás Nunes 2018 年 3 月 19 日
how would it look if we had a matrix instead? for example, a 3x3 matrix, in which I want to rank by row. A = [4 3 6;7 8 3; 2 4 1] to look like this idx = [2 3 1; 2 1 3; 2 1 3]

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by