Matlab Code for rank.mean

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 日

0 投票

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 日

0 投票

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.

カテゴリ

ヘルプ センター および File ExchangeShifting and Sorting Matrices についてさらに検索

質問済み:

2017 年 2 月 10 日

回答済み:

2017 年 2 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by