how to track location of number in array after sorting?

조회 수: 1 (최근 30일)
Ali Mukhtar
Ali Mukhtar 2019년 9월 2일
댓글: Ali Mukhtar 2019년 9월 2일
i have a array B=[ 95 75 80 90 40 55] which i want to save data like B=[B1 B2 B3 B4 B5 B6] after sorting i got B=[95 90 80 75 55 40] now i want the exact location of B array like B=[B1 B4 B3 B2 B6 B5] want to know changed location and also want to use the numeric value of B1 for example want to save in n=1 to use for selection purpose.

채택된 답변

madhan ravi
madhan ravi 2019년 9월 2일
[~,Wanted] = sort(B,'descend')
  댓글 수: 7
madhan ravi
madhan ravi 2019년 9월 2일
retriever
Ali Mukhtar
Ali Mukhtar 2019년 9월 2일
great thanks for your help. it is very kind of you giving me reply

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by