Home > matlab > dsample.m

dsample

PURPOSE ^

function dsample(s1,s2)

SYNOPSIS ^

function dsample(s1,s2)

DESCRIPTION ^

 function dsample(s1,s2)
 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

 INPUTS
    s1:      first period
    s2:      last period
    
 OUTPUTS
    none
    
 SPECIAL REQUIREMENTS
    none

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function dsample(s1,s2)
0002 % function dsample(s1,s2)
0003 % This optional command permits to reduce the number of periods considered in following output commands.
0004 % If only one argument is provided, output is from period 1 to the period specified in the DSAMPLE command.
0005 % If two arguments are present output is done for the interval between the two periods.
0006 % DSAMPLE without arguments reset the sample to the one specified by PERIODS
0007 %
0008 % INPUTS
0009 %    s1:      first period
0010 %    s2:      last period
0011 %
0012 % OUTPUTS
0013 %    none
0014 %
0015 % SPECIAL REQUIREMENTS
0016 %    none
0017 
0018 % Copyright (C) 2001-2009 Dynare Team
0019 %
0020 % This file is part of Dynare.
0021 %
0022 % Dynare is free software: you can redistribute it and/or modify
0023 % it under the terms of the GNU General Public License as published by
0024 % the Free Software Foundation, either version 3 of the License, or
0025 % (at your option) any later version.
0026 %
0027 % Dynare is distributed in the hope that it will be useful,
0028 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0029 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0030 % GNU General Public License for more details.
0031 %
0032 % You should have received a copy of the GNU General Public License
0033 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
0034 
0035 global options_
0036 
0037 options_.smpl = zeros(2,1) ;
0038 
0039 if nargin == 0
0040     options_.smpl(1) = 1 ;
0041     options_.smpl(2) = options_.periods ;
0042 elseif nargin == 1
0043     if s1 > options_.periods
0044         error('DSAMPLE: argument greater than number of periods');
0045     end
0046     options_.smpl(1) = 1 ;
0047     options_.smpl(2) = s1 ;
0048 else
0049     if s1 > options_.periods || s2 > options_.periods
0050         error('DSAMPLE: one of the arguments is greater than number of periods');
0051     end
0052     options_.smpl(1) = s1 ;
0053     options_.smpl(2) = s2 ;
0054 end
0055 
0056 % 02/23/01 MJ added error checking

Generated on Mon 21-May-2012 02:42:43 by m2html © 2005