Matlab Code for rank.mean

조회 수: 1 (최근 30일)
Sonja Di Blasio
Sonja Di Blasio 2017년 2월 10일
답변: Steven Lord 2017년 2월 10일
How can I calculate the rank mean, that is the position of a number than a list of numbers?
  댓글 수: 1
José-Luis
José-Luis 2017년 2월 10일
Are you talking about percentiles?

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

답변 (2개)

Rik
Rik 2017년 2월 10일
If you mean that the function should find the position of a value in a sorted vector, the code below should do that.
x = [4 9 3 1.2];
value_to_find=4;
position=find(value_to_find==sort(x),1,'first');
If this is not what you mean, please provide an example with the intended result.

Steven Lord
Steven Lord 2017년 2월 10일
The second output of the sort function should get you close to what you want, depending on how you want to handle ties. You may also want to discretize your data with bins generated using the unique elements in your array.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by