Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

Re: sorting, ranking

$
0
0
"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

Viewing all articles
Browse latest Browse all 19628

Trending Articles