Version 3.1.2 (3,2 KB) von Jos (10584)
compute the rank number (rankings) of elements
Aktualisiert 16. Feb 2019

Lizenz anzeigen

R = ranknum(V) returns the rank numbers of the elements of the (numerical) vector V, using the dense ranking procedure for ties (see below).
NaNs are ignored (rank NaN). R has the same size as V.

R = ranknum(V, P) ranks V according to the ranking procedure P, which specifies how to deal with values that tie for the same ranking position. P is a number from 1 to 5.
1 - Dense "1223"
2 - Ordinal "1234"
3 - Competition "1224"
4 - Modified Competition "1334"
5 - Fractional "1 2.5 2.5 4"

V can be a cell array of strings, for which alphabetical ordering is used.

For more info on ranking, see https://en.wikipedia.org/wiki/Ranking

Zitieren als

Jos (10584) (2024). ranknum (https://www.mathworks.com/matlabcentral/fileexchange/70301-ranknum), MATLAB Central File Exchange. Abgerufen .

Kompatibilität der MATLAB-Version
Erstellt mit R2018b
Kompatibel mit allen Versionen
Windows macOS Linux
Mehr zu Logical finden Sie in Help Center und MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Veröffentlicht Versionshinweise

minor edits (dots and commas)

cleaned up description on file exchange


minor edits (spaces)