5.0

5.0 | 1 rating Rate this file 11 Downloads (last 30 days) File Size: 1.79 KB File ID: #34560

Tiedrank_(X,dim)

by

 

12 Jan 2012 (Updated )

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

| Watch this File

File Information
Description

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

Required Products MATLAB
MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
06 Jun 2012 Francesco Pozzi

Very useful indeed! Thank you for that.

Updates
13 Jan 2012

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

14 Jan 2012

Did a couple of optimising tweaks.

Contact us