This function returns a NUMBER for a given PERCENTILE.
I don’t know what the OP had in mind, but e.g. what I am looking for right now is exactly the thing that the name of this thread points to and which is the very opposite of the percentile function, i.e. given numbers in a collection, I would like to know their percentiles.
E.g. I have a long vector of numbers, and I would like to create another vector that contains percentiles of respective numbers in the original vector. How can I do that without writing a long program?
The percentilerank is just fine, but to answer your question:
f = ecdf(X) creates a function (similar to an interpolated percentilerank). You can use it later as f(y) or f.(y) where y are some values (eg same as X)