필터 지우기
필터 지우기

How to find indices of ranking of element in matrix

조회 수: 8 (최근 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 CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by