File Exchange

image thumbnail

Tiedrank_(X,dim)

version 1.3 (1.79 KB) by

Like MATLAB's tiedrank function, but works along dimension dim of ND-array.

1 Download

Updated

View License

r = tiedrank_(X,dim)

Parameters:
[X] is a multidimensional array.
[dim] specifies which dimension to perform ranking on.

Returns:
[r] ranked values of X along dimension dim. Where values are the same the mean rank is
given (e.g. [99 110 50 13 99] goes to [ 3.5 5 2 1 3.5] )

Code is fully vectorised.

-- DM, Jan 2012

Comments and Ratings (2)

Very useful indeed! Thank you for that.

Updates

1.3

Did a couple of optimising tweaks.

1.1

Corrected line 16, now reads:
otherDims = 1:length(size(X));

MATLAB Release
MATLAB 7.10 (R2010a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video