2017-05-16 12:42:01 +02:00
|
|
|
function y = myprctilecol(x,p)
|
2012-01-09 13:12:31 +01:00
|
|
|
|
2017-02-03 12:48:27 +01:00
|
|
|
% Written by Marco Ratto
|
|
|
|
% Joint Research Centre, The European Commission,
|
2017-05-16 15:10:20 +02:00
|
|
|
% marco.ratto@ec.europa.eu
|
2017-02-03 12:48:27 +01:00
|
|
|
|
2022-04-13 13:15:19 +02:00
|
|
|
% Copyright © 2012 European Commission
|
|
|
|
% Copyright © 2012-2017 Dynare Team
|
2012-01-09 13:12:31 +01:00
|
|
|
%
|
|
|
|
% This file is part of Dynare.
|
|
|
|
%
|
|
|
|
% Dynare is free software: you can redistribute it and/or modify
|
|
|
|
% it under the terms of the GNU General Public License as published by
|
|
|
|
% the Free Software Foundation, either version 3 of the License, or
|
|
|
|
% (at your option) any later version.
|
|
|
|
%
|
|
|
|
% Dynare is distributed in the hope that it will be useful,
|
|
|
|
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
% GNU General Public License for more details.
|
|
|
|
%
|
|
|
|
% You should have received a copy of the GNU General Public License
|
2021-06-09 17:33:48 +02:00
|
|
|
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
|
2012-01-09 13:12:31 +01:00
|
|
|
|
2011-12-09 21:13:16 +01:00
|
|
|
xx = sort(x);
|
|
|
|
[m,n] = size(x);
|
|
|
|
|
|
|
|
if m==1 | n==1
|
|
|
|
m = max(m,n);
|
2017-05-16 15:10:20 +02:00
|
|
|
if m == 1
|
|
|
|
y = x*ones(length(p),1);
|
|
|
|
return
|
|
|
|
end
|
2011-12-09 21:13:16 +01:00
|
|
|
n = 1;
|
|
|
|
q = 100*(0.5:m - 0.5)./m;
|
|
|
|
xx = [min(x); xx(:); max(x)];
|
|
|
|
else
|
|
|
|
q = 100*(0.5:m - 0.5)./m;
|
|
|
|
xx = [min(x); xx; max(x)];
|
|
|
|
end
|
|
|
|
|
|
|
|
q = [0 q 100];
|
2008-04-23 14:13:31 +02:00
|
|
|
y = interp1(q,xx,p);
|