function f=ranks(x)
  n = length(x);
  n=1:n;
  [dum,ii]=sort(x);
  f(ii) = n;