Date: Jan 14, 2013 1:25 PM
Author: Bruno Luong
Subject: Re: sorting, ranking

"Nir" wrote in message <kd1c0h$1pl$1@newscl01ah.mathworks.com>...
> Dear all,
>
> Here is a one-liner for getting ranks with ties:
> [~,rank_vector]=ismember(data_vector,unique(sort(data_vector)));
>



Or simply:
[~,~,rank_vector] = unique(data_vector)

% Bruno