compute rank of samples, the mean value is used in case of ties
rank of vector X
this function is just a wrapper for RANKS, and provided for compatibility with the statistics toolbox of matlab(tm)
Counting from smallest to largest, the two 20 values are 2nd and 3rd, so they both get rank 2.5 (average of 2 and 3): nan_tiedrank([10 20 30 40 20]); ans = 1.0000 2.5000 4.0000 5.0000 2.5000