1 function Q=prctile(Y,q,DIM)
2 % PRCTILE calculates the percentiles of histograms and sample arrays.
3 % (its the same than PERCENTILE.M)
7 % returns the q-th percentile along dimension DIM of sample array Y.
8 % size(Q) is equal size(Y) except for dimension DIM which is size(Q,DIM)=length(Q)
11 % returns the q-th percentile from the histogram HIS.
12 % HIS must be a HISTOGRAM struct as defined in HISTO2 or HISTO3.
13 % If q is a vector, the each row of Q returns the q(i)-th percentile
15 % see also: HISTO2, HISTO3, QUANTILE
18 % Copyright (C) 1996-2003,2005,2006,2007,2009 by Alois Schloegl <alois.schloegl@gmail.com>
19 % This function is part of the NaN-toolbox
20 % http://pub.ist.ac.at/~schloegl/matlab/NaN/
22 % This program is free software; you can redistribute it and/or modify
23 % it under the terms of the GNU General Public License as published by
24 % the Free Software Foundation; either version 2 of the License, or
25 % (at your option) any later version.
27 % This program is distributed in the hope that it will be useful,
28 % but WITHOUT ANY WARRANTY; without even the implied warranty of
29 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 % GNU General Public License for more details.
32 % You should have received a copy of the GNU General Public License
33 % along with this program; If not, see <http://www.gnu.org/licenses/>.
37 Q = quantile(Y,q/100);
40 Q = quantile(Y,q/100,DIM);