1 function R=tiedrank(X,DIM)
2 % TIEDRANK compute rank of samples, the mean value is used in case of ties
3 % this function is just a wrapper for RANKS, and provided for compatibility
4 % with the statistics toolbox of matlab(tm)
7 % computes the rank R of vector X
12 % $Id: tiedrank.m 8223 2011-04-20 09:16:06Z schloegl $
13 % Copyright (C) 2009,2010 by Alois Schloegl <alois.schloegl@gmail.com>
14 % This function is part of the NaN-toolbox
15 % http://pub.ist.ac.at/~schloegl/matlab/NaN/
17 % This program is free software; you can redistribute it and/or modify
18 % it under the terms of the GNU General Public License as published by
19 % the Free Software Foundation; either version 3 of the License, or
20 % (at your option) any later version.
22 % This program is distributed in the hope that it will be useful,
23 % but WITHOUT ANY WARRANTY; without even the implied warranty of
24 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 % GNU General Public License for more details.
27 % You should have received a copy of the GNU General Public License
28 % along with this program; If not, see <http://www.gnu.org/licenses/>.
32 error('more than 1 input argument is currently not supported ')
36 error('more than 1 output argument is currently not supported ')
43 DIM = find(size(X)>1,1);
44 if isempty(DIM), DIM = 1; end;
46 if (DIM<1), DIM = 1; end; %% Hack, because min([])=0 for FreeMat v3.5