2 % IQR calculates the interquartile range
3 % Missing values (encoded as NaN) are ignored.
7 % returns the IQR along dimension DIM of sample array Y.
10 % returns the IQR from the histogram HIS.
11 % HIS must be a HISTOGRAM struct as defined in HISTO2 or HISTO3.
13 % see also: MAD, RANGE, HISTO2, HISTO3, PERCENTILE, QUANTILE
17 % Copyright (C) 2009 by Alois Schloegl <alois.schloegl@gmail.com>
18 % This function is part of the NaN-toolbox
19 % http://pub.ist.ac.at/~schloegl/matlab/NaN/
21 % This program is free software; you can redistribute it and/or modify
22 % it under the terms of the GNU General Public License as published by
23 % the Free Software Foundation; either version 3 of the License, or
24 % (at your option) any later version.
26 % This program is distributed in the hope that it will be useful,
27 % but WITHOUT ANY WARRANTY; without even the implied warranty of
28 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 % GNU General Public License for more details.
31 % You should have received a copy of the GNU General Public License
32 % along with this program; If not, see <http://www.gnu.org/licenses/>.
38 DIM = min(find(size(Y)>1));
39 if isempty(DIM), DIM = 1; end;
47 Q = quantile(Y,[1,3]/4,DIM);