www.gusucode.com > datafun 工具箱matlab源码程序 > datafun/private/datafuniqr.m

    function y = datafuniqr(x)
% DATAFUNIQR Compute interquartile range for histogram functions

%   Copyright 1984-2015 The MathWorks, Inc.

n = numel(x);
F = ((1:n)'-.5) / n;
if ~isfloat(x)
    x = double(x);
end
if n > 0
    y = diff(interp1q(F, sort(x(:)), [.25; .75]));
else
    y = NaN('like',x);
end