Copyright (C) 2001 Michel Juillard DSAMPLE : DSAMPLE(d1,d2) This optional command permits to reduce the number of periods considered in following output commands. If only one argument is provided, output is from period 1 to the period specified in the DSAMPLE command. If two arguments are present output is done for the interval between the two periods. DSAMPLE without arguments reset the sample to the one specified by PERIODS
0001 % Copyright (C) 2001 Michel Juillard 0002 % 0003 function dsample(s1,s2) 0004 % DSAMPLE : DSAMPLE(d1,d2) 0005 % This optional command permits to reduce the number of 0006 % periods considered in following output commands. 0007 % If only one argument is 0008 % provided, output is from period 1 to the period 0009 % specified in the DSAMPLE command. If two arguments are 0010 % present output is done for the interval between the 0011 % two periods. 0012 % DSAMPLE without arguments reset the sample to the one 0013 % specified by PERIODS 0014 0015 global options_ 0016 0017 options_.smpl = zeros(2,1) ; 0018 0019 if s1 > options_.periods | s2 > options_.periods 0020 t = ['DYNARE dsample error: one of the arguments is larger than the one' ... 0021 ' specified in PERIODS']; 0022 error(t); 0023 end 0024 0025 if nargin == 0 0026 options_.smpl(1) = 1 ; 0027 options_.smpl(2) = options_.periods ; 0028 elseif nargin == 1 0029 options_.smpl(1) = 1 ; 0030 options_.smpl(2) = s1 ; 0031 else 0032 options_.smpl(1) = s1 ; 0033 options_.smpl(2) = s2 ; 0034 end 0035 0036 % 02/23/01 MJ added error checking