Is this answer any good? it's off the www.
Subject:
How do I calculate the percent rank of each value in an array using MATLAB?
Problem Description:
I have a set of values, and I would like to calculate the percent rank (percentile) for each value in the data set.
Solution:
A function to calculate the percent rank of each element of a matrix is not available in MATLAB.
To work around this issue, use the function TIEDRANK from the Statistics Toolbox and normalize by dividing by the length of the input vector. This converts the result to percentiles.
See the following example code:
x = rand(1,40);
tiedrank(x)/length(x);