Changed name of dynDates class to dynDate. dynDates will be used latter for irregular and unsorted sequence of dates.

time-shift
Stéphane Adjemian (Charybdis) 2011-10-03 16:34:44 +02:00
parent ead128eec8
commit 01bfd371d2
17 changed files with 203 additions and 203 deletions

View File

@ -2,17 +2,17 @@ function sp = colon(a,b)
%@info: %@info:
%! @deftypefn {Function File} {@var{sp} =} colon (@var{a},@var{b}) %! @deftypefn {Function File} {@var{sp} =} colon (@var{a},@var{b})
%! @anchor{@dynDates/colon} %! @anchor{@dynDate/colon}
%! @sp 1 %! @sp 1
%! Overloads the colon operator for the Dynare Dates class (@ref{dynDates}). Creates a @ref{dynTime} object. %! Overloads the colon operator for the Dynare Dates class (@ref{dynDate}). Creates a @ref{dynTime} object.
%! @sp 2 %! @sp 2
%! @strong{Inputs} %! @strong{Inputs}
%! @sp 1 %! @sp 1
%! @table @ @var %! @table @ @var
%! @item a %! @item a
%! Dynare date object instantiated by @ref{dynDates}, initial date. %! Dynare date object instantiated by @ref{dynDate}, initial date.
%! @item b %! @item b
%! Dynare date object instantiated by @ref{dynDates}, last date. %! Dynare date object instantiated by @ref{dynDate}, last date.
%! @end table %! @end table
%! @sp 1 %! @sp 1
%! @strong{Outputs} %! @strong{Outputs}
@ -52,8 +52,8 @@ if nargin~=2
error('dynTime::colon: I need exactly two input arguments!') error('dynTime::colon: I need exactly two input arguments!')
end end
if ~( isa(a,'dynDates') && isa(b,'dynDates')) if ~( isa(a,'dynDate') && isa(b,'dynDate'))
error(['dynTime::colon: Input arguments ' inputname(1) 'and ' inputname(2) ' have to be a dynDates objects!']) error(['dynTime::colon: Input arguments ' inputname(1) 'and ' inputname(2) ' have to be a dynDate objects!'])
end end
if a.freq~=b.freq if a.freq~=b.freq
@ -93,8 +93,8 @@ end
%$ e.time = [1950 2; 1950 3; 1950 4; 1951 1; 1951 2; 1951 3; 1951 4]; %$ e.time = [1950 2; 1950 3; 1950 4; 1951 1; 1951 2; 1951 3; 1951 4];
%$ %$
%$ % Call the tested routine. %$ % Call the tested routine.
%$ d1 = dynDates(date_1); %$ d1 = dynDate(date_1);
%$ d2 = dynDates(date_2); %$ d2 = dynDate(date_2);
%$ d3 = d1:d2; %$ d3 = d1:d2;
%$ %$
%$ % Check the results. %$ % Check the results.

View File

@ -1,8 +1,8 @@
function date = dynDates(a) function date = dynDate(a)
%@info: %@info:
%! @deftypefn {Function File} {@var{date} =} dynDate (@var{a}) %! @deftypefn {Function File} {@var{date} =} dynDate (@var{a})
%! @anchor{dynDates} %! @anchor{dynDate}
%! @sp 1 %! @sp 1
%! Constructor for the Dynare dates class. %! Constructor for the Dynare dates class.
%! @sp 2 %! @sp 2
@ -11,8 +11,8 @@ function date = dynDates(a)
%! @table @ @var %! @table @ @var
%! @item a %! @item a
%! Date. For Quaterly, Monthly or Weekly data, a must be a string. For yearly data or if the frequence is not %! Date. For Quaterly, Monthly or Weekly data, a must be a string. For yearly data or if the frequence is not
%! defined must be an integer. If @var{a} is a dynDates object, then date will be a copy of this object. If %! defined must be an integer. If @var{a} is a dynDate object, then date will be a copy of this object. If
%! the constructor is called without input argument, it will return an empty dynDates object. %! the constructor is called without input argument, it will return an empty dynDate object.
%! @end table %! @end table
%! @sp 1 %! @sp 1
%! @strong{Outputs} %! @strong{Outputs}
@ -66,7 +66,7 @@ date = struct;
date.freq = NaN; date.freq = NaN;
date.time = NaN(1,2); date.time = NaN(1,2);
date = class(date,'dynDates'); date = class(date,'dynDate');
switch nargin switch nargin
case 0 case 0
@ -93,7 +93,7 @@ switch nargin
end end
if isempty(quaterly) && isempty(monthly) && isempty(weekly) if isempty(quaterly) && isempty(monthly) && isempty(weekly)
if any(isletter(a)) if any(isletter(a))
error('dynDates:: Using a string as an input argument, I can only handle weekly (W), monthly (M) or quaterly (Q) data!'); error('dynDate:: Using a string as an input argument, I can only handle weekly (W), monthly (M) or quaterly (Q) data!');
else else
% Yearly data declared with a string % Yearly data declared with a string
date.freq = 1; date.freq = 1;
@ -101,7 +101,7 @@ switch nargin
date.time(2) = 1; date.time(2) = 1;
end end
end end
elseif isa(a,'dynDates') % If input argument is a dynDates object then do a copy. elseif isa(a,'dynDate') % If input argument is a dynDate object then do a copy.
date = a; date = a;
else% If b is not a string then yearly data are assumed. else% If b is not a string then yearly data are assumed.
date.freq = 1; date.freq = 1;
@ -109,7 +109,7 @@ switch nargin
date.time(2) = 1; date.time(2) = 1;
end end
otherwise otherwise
error('dynDates:: Can''t instantiate the class, wrong calling sequence!') error('dynDate:: Can''t instantiate the class, wrong calling sequence!')
end end
%@test:1 %@test:1
@ -135,11 +135,11 @@ end
%$ e_freq_5 = 1; %$ e_freq_5 = 1;
%$ %$
%$ % Call the tested routine. %$ % Call the tested routine.
%$ d1 = dynDates(date_1); %$ d1 = dynDate(date_1);
%$ d2 = dynDates(date_2); %$ d2 = dynDate(date_2);
%$ d3 = dynDates(date_3); %$ d3 = dynDate(date_3);
%$ d4 = dynDates(date_4); %$ d4 = dynDate(date_4);
%$ d5 = dynDates(date_5); %$ d5 = dynDate(date_5);
%$ %$
%$ % Check the results. %$ % Check the results.
%$ t(1) = dyn_assert(d1.time,e_date_1); %$ t(1) = dyn_assert(d1.time,e_date_1);

View File

@ -2,17 +2,17 @@ function c = eq(a,b)
%@info: %@info:
%! @deftypefn {Function File} {@var{c} =} eq (@var{a},@var{b}) %! @deftypefn {Function File} {@var{c} =} eq (@var{a},@var{b})
%! @anchor{@dynDates/eq} %! @anchor{@dynDate/eq}
%! @sp 1 %! @sp 1
%! Overloads the eq (equal) operator for the Dynare dates class (@ref{dynDates}). %! Overloads the eq (equal) operator for the Dynare dates class (@ref{dynDate}).
%! @sp 2 %! @sp 2
%! @strong{Inputs} %! @strong{Inputs}
%! @sp 1 %! @sp 1
%! @table @ @var %! @table @ @var
%! @item a %! @item a
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @item b %! @item b
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @end table %! @end table
%! @sp 1 %! @sp 1
%! @strong{Outputs} %! @strong{Outputs}
@ -50,15 +50,15 @@ function c = eq(a,b)
verbose = 0; verbose = 0;
if nargin~=2 if nargin~=2
error('dynDates::eq: I need exactly two input arguments!') error('dynDate::eq: I need exactly two input arguments!')
end end
if ~( isa(a,'dynDates') && isa(b,'dynDates')) if ~( isa(a,'dynDate') && isa(b,'dynDate'))
error(['dynDates::eq: Input arguments ' inputname(1) 'and ' inputname(2) ' have to be a dynDates objects!']) error(['dynDate::eq: Input arguments ' inputname(1) 'and ' inputname(2) ' have to be a dynDate objects!'])
end end
if verbose && a.freq~=b.freq if verbose && a.freq~=b.freq
disp(['dynDates::eq: Input arguments ' inputname(1) 'and ' inputname(2) ' have no common frequencies!']) disp(['dynDate::eq: Input arguments ' inputname(1) 'and ' inputname(2) ' have no common frequencies!'])
c = 0; c = 0;
end end
@ -75,11 +75,11 @@ c = isequal(a.time,b.time);
%$ date_5 = '1950W32'; %$ date_5 = '1950W32';
%$ %$
%$ % Call the tested routine. %$ % Call the tested routine.
%$ d1 = dynDates(date_1); %$ d1 = dynDate(date_1);
%$ d2 = dynDates(date_2); %$ d2 = dynDate(date_2);
%$ d3 = dynDates(date_3); %$ d3 = dynDate(date_3);
%$ d4 = dynDates(date_4); %$ d4 = dynDate(date_4);
%$ d5 = dynDates(date_5); %$ d5 = dynDate(date_5);
%$ i1 = (d1==d2); %$ i1 = (d1==d2);
%$ i2 = (d2==d2); %$ i2 = (d2==d2);
%$ i3 = (d4==d5); %$ i3 = (d4==d5);

View File

@ -2,15 +2,15 @@ function p = format(date)
%@info: %@info:
%! @deftypefn {Function File} {@var{p} =} format (@var{date}) %! @deftypefn {Function File} {@var{p} =} format (@var{date})
%! @anchor{@dynDates/format} %! @anchor{@dynDate/format}
%! @sp 1 %! @sp 1
%! Produces a formatted date from a Dynare date object instantiated by @ref{dynDates}. %! Produces a formatted date from a Dynare date object instantiated by @ref{dynDate}.
%! @sp 2 %! @sp 2
%! @strong{Inputs} %! @strong{Inputs}
%! @sp 1 %! @sp 1
%! @table @ @var %! @table @ @var
%! @item date %! @item date
%! Dynare date object, instantiated by @ref{dynDates}. %! Dynare date object, instantiated by @ref{dynDate}.
%! @end table %! @end table
%! @sp 1 %! @sp 1
%! @strong{Outputs} %! @strong{Outputs}
@ -47,11 +47,11 @@ function p = format(date)
if nargin~=1 if nargin~=1
error('dynDates::format: I need exactly one input argument!') error('dynDate::format: I need exactly one input argument!')
end end
if ~isa(date,'dynDates') if ~isa(date,'dynDate')
error(['dynDates::format: Input argument ' inputname(1) ' has to be a dynDates object!']) error(['dynDate::format: Input argument ' inputname(1) ' has to be a dynDate object!'])
end end
switch date.freq switch date.freq
@ -64,7 +64,7 @@ switch date.freq
case 52 case 52
p = [num2str(date.time(1)) 'W' num2str(date.time(2))]; p = [num2str(date.time(1)) 'W' num2str(date.time(2))];
otherwise otherwise
error('dynDates::format: Unkonwn frequency!') error('dynDate::format: Unkonwn frequency!')
end end
%@test:1 %@test:1
@ -77,10 +77,10 @@ end
%$ date_4 = '1950W50'; %$ date_4 = '1950W50';
%$ %$
%$ % Call the tested routine. %$ % Call the tested routine.
%$ d1 = dynDates(date_1); DATE_1 = format(d1); %$ d1 = dynDate(date_1); DATE_1 = format(d1);
%$ d2 = dynDates(date_2); DATE_2 = format(d2); %$ d2 = dynDate(date_2); DATE_2 = format(d2);
%$ d3 = dynDates(date_3); DATE_3 = format(d3); %$ d3 = dynDate(date_3); DATE_3 = format(d3);
%$ d4 = dynDates(date_4); DATE_4 = format(d4); %$ d4 = dynDate(date_4); DATE_4 = format(d4);
%$ %$
%$ % Check the results. %$ % Check the results.
%$ t(1) = dyn_assert(num2str(date_1),DATE_1); %$ t(1) = dyn_assert(num2str(date_1),DATE_1);

View File

@ -2,17 +2,17 @@ function c = ge(a,b)
%@info: %@info:
%! @deftypefn {Function File} {@var{c} =} ge (@var{a},@var{b}) %! @deftypefn {Function File} {@var{c} =} ge (@var{a},@var{b})
%! @anchor{@dynDates/ge} %! @anchor{@dynDate/ge}
%! @sp 1 %! @sp 1
%! Overloads the ge (greater or equal) operator for the Dynare dates class (@ref{dynDates}). %! Overloads the ge (greater or equal) operator for the Dynare dates class (@ref{dynDate}).
%! @sp 2 %! @sp 2
%! @strong{Inputs} %! @strong{Inputs}
%! @sp 1 %! @sp 1
%! @table @ @var %! @table @ @var
%! @item a %! @item a
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @item b %! @item b
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @end table %! @end table
%! @sp 1 %! @sp 1
%! @strong{Outputs} %! @strong{Outputs}
@ -25,7 +25,7 @@ function c = ge(a,b)
%! @strong{This function is called by:} %! @strong{This function is called by:}
%! @sp 2 %! @sp 2
%! @strong{This function calls:} %! @strong{This function calls:}
%! @ref{@@dynDates/gt}, @ref{@@dynDates/eq} %! @ref{@@dynDate/gt}, @ref{@@dynDate/eq}
%! %!
%! @end deftypefn %! @end deftypefn
%@eod: %@eod:
@ -68,10 +68,10 @@ end
%$ date_4 = '1949Q2'; %$ date_4 = '1949Q2';
%$ %$
%$ % Call the tested routine. %$ % Call the tested routine.
%$ d1 = dynDates(date_1); %$ d1 = dynDate(date_1);
%$ d2 = dynDates(date_2); %$ d2 = dynDate(date_2);
%$ d3 = dynDates(date_3); %$ d3 = dynDate(date_3);
%$ d4 = dynDates(date_4); %$ d4 = dynDate(date_4);
%$ i1 = (d1>=d2); %$ i1 = (d1>=d2);
%$ i2 = (d3>=d4); %$ i2 = (d3>=d4);
%$ i3 = (d4>=d2); %$ i3 = (d4>=d2);

View File

@ -2,17 +2,17 @@ function c = gt(a,b)
%@info: %@info:
%! @deftypefn {Function File} {@var{c} =} gt (@var{a},@var{b}) %! @deftypefn {Function File} {@var{c} =} gt (@var{a},@var{b})
%! @anchor{@dynDates/gt} %! @anchor{@dynDate/gt}
%! @sp 1 %! @sp 1
%! Overloads the gt (greater than) operator for the Dynare dates class (@ref{dynDates}). %! Overloads the gt (greater than) operator for the Dynare dates class (@ref{dynDate}).
%! @sp 2 %! @sp 2
%! @strong{Inputs} %! @strong{Inputs}
%! @sp 1 %! @sp 1
%! @table @ @var %! @table @ @var
%! @item a %! @item a
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @item b %! @item b
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @end table %! @end table
%! @sp 1 %! @sp 1
%! @strong{Outputs} %! @strong{Outputs}
@ -50,15 +50,15 @@ function c = gt(a,b)
verbose = 0; verbose = 0;
if nargin~=2 if nargin~=2
error('dynDates::eq: I need exactly two input arguments!') error('dynDate::eq: I need exactly two input arguments!')
end end
if ~( isa(a,'dynDates') && isa(b,'dynDates')) if ~( isa(a,'dynDate') && isa(b,'dynDate'))
error(['dynDates::eq: Input arguments ' inputname(1) 'and ' inputname(2) ' have to be a dynDates objects!']) error(['dynDate::eq: Input arguments ' inputname(1) 'and ' inputname(2) ' have to be a dynDate objects!'])
end end
if verbose && a.freq~=b.freq if verbose && a.freq~=b.freq
error(['dynDates::eq: Input arguments ' inputname(1) 'and ' inputname(2) ' have no common frequencies!']) error(['dynDate::eq: Input arguments ' inputname(1) 'and ' inputname(2) ' have no common frequencies!'])
end end
if a.time(1)>b.time(1) if a.time(1)>b.time(1)
@ -84,11 +84,11 @@ end
%$ date_5 = '1949Q2'; %$ date_5 = '1949Q2';
%$ %$
%$ % Call the tested routine. %$ % Call the tested routine.
%$ d1 = dynDates(date_1); %$ d1 = dynDate(date_1);
%$ d2 = dynDates(date_2); %$ d2 = dynDate(date_2);
%$ d3 = dynDates(date_3); %$ d3 = dynDate(date_3);
%$ d4 = dynDates(date_4); %$ d4 = dynDate(date_4);
%$ d5 = dynDates(date_5); %$ d5 = dynDate(date_5);
%$ i1 = (d2>d3); %$ i1 = (d2>d3);
%$ i2 = (d3>d4); %$ i2 = (d3>d4);
%$ i3 = (d4>d2); %$ i3 = (d4>d2);

View File

@ -2,17 +2,17 @@ function c = le(a,b)
%@info: %@info:
%! @deftypefn {Function File} {@var{c} =} le (@var{a},@var{b}) %! @deftypefn {Function File} {@var{c} =} le (@var{a},@var{b})
%! @anchor{@dynDates/le} %! @anchor{@dynDate/le}
%! @sp 1 %! @sp 1
%! Overloads the le (less or equal) operator for the Dynare dates class (@ref{dynDates}). %! Overloads the le (less or equal) operator for the Dynare dates class (@ref{dynDate}).
%! @sp 2 %! @sp 2
%! @strong{Inputs} %! @strong{Inputs}
%! @sp 1 %! @sp 1
%! @table @ @var %! @table @ @var
%! @item a %! @item a
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @item b %! @item b
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @end table %! @end table
%! @sp 1 %! @sp 1
%! @strong{Outputs} %! @strong{Outputs}
@ -25,7 +25,7 @@ function c = le(a,b)
%! @strong{This function is called by:} %! @strong{This function is called by:}
%! @sp 2 %! @sp 2
%! @strong{This function calls:} %! @strong{This function calls:}
%! @ref{@@dynDates/lt}, @ref{@@dynDates/eq} %! @ref{@@dynDate/lt}, @ref{@@dynDate/eq}
%! %!
%! @end deftypefn %! @end deftypefn
%@eod: %@eod:
@ -68,10 +68,10 @@ end
%$ date_4 = '1949Q2'; %$ date_4 = '1949Q2';
%$ %$
%$ % Call the tested routine. %$ % Call the tested routine.
%$ d1 = dynDates(date_1); %$ d1 = dynDate(date_1);
%$ d2 = dynDates(date_2); %$ d2 = dynDate(date_2);
%$ d3 = dynDates(date_3); %$ d3 = dynDate(date_3);
%$ d4 = dynDates(date_4); %$ d4 = dynDate(date_4);
%$ i1 = (d1<=d2); %$ i1 = (d1<=d2);
%$ i2 = (d3<=d4); %$ i2 = (d3<=d4);
%$ i3 = (d4<=d2); %$ i3 = (d4<=d2);

View File

@ -2,17 +2,17 @@ function c = lt(a,b)
%@info: %@info:
%! @deftypefn {Function File} {@var{c} =} lt (@var{a},@var{b}) %! @deftypefn {Function File} {@var{c} =} lt (@var{a},@var{b})
%! @anchor{@dynDates/lt} %! @anchor{@dynDate/lt}
%! @sp 1 %! @sp 1
%! Overloads the lt (less than) operator for the Dynare dates class (@ref{dynDates}). %! Overloads the lt (less than) operator for the Dynare dates class (@ref{dynDate}).
%! @sp 2 %! @sp 2
%! @strong{Inputs} %! @strong{Inputs}
%! @sp 1 %! @sp 1
%! @table @ @var %! @table @ @var
%! @item a %! @item a
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @item b %! @item b
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @end table %! @end table
%! @sp 1 %! @sp 1
%! @strong{Outputs} %! @strong{Outputs}
@ -50,15 +50,15 @@ function c = lt(a,b)
verbose = 0; verbose = 0;
if nargin~=2 if nargin~=2
error('dynDates::eq: I need exactly two input arguments!') error('dynDate::eq: I need exactly two input arguments!')
end end
if ~( isa(a,'dynDates') && isa(b,'dynDates')) if ~( isa(a,'dynDate') && isa(b,'dynDate'))
error(['dynDates::eq: Input arguments ' inputname(1) 'and ' inputname(2) ' have to be a dynDates objects!']) error(['dynDate::eq: Input arguments ' inputname(1) 'and ' inputname(2) ' have to be a dynDate objects!'])
end end
if verbose && a.freq~=b.freq if verbose && a.freq~=b.freq
error(['dynDates::eq: Input arguments ' inputname(1) 'and ' inputname(2) ' have no common frequencies!']) error(['dynDate::eq: Input arguments ' inputname(1) 'and ' inputname(2) ' have no common frequencies!'])
end end
if a.time(1)<b.time(1) if a.time(1)<b.time(1)
@ -84,11 +84,11 @@ end
%$ date_5 = '1949Q2'; %$ date_5 = '1949Q2';
%$ %$
%$ % Call the tested routine. %$ % Call the tested routine.
%$ d1 = dynDates(date_1); %$ d1 = dynDate(date_1);
%$ d2 = dynDates(date_2); %$ d2 = dynDate(date_2);
%$ d3 = dynDates(date_3); %$ d3 = dynDate(date_3);
%$ d4 = dynDates(date_4); %$ d4 = dynDate(date_4);
%$ d5 = dynDates(date_5); %$ d5 = dynDate(date_5);
%$ i1 = (d2<d3); %$ i1 = (d2<d3);
%$ i2 = (d3<d4); %$ i2 = (d3<d4);
%$ i3 = (d4<d2); %$ i3 = (d4<d2);

View File

@ -2,24 +2,24 @@ function c = max(a,b)
%@info: %@info:
%! @deftypefn {Function File} {@var{c} =} max (@var{a},@var{b}) %! @deftypefn {Function File} {@var{c} =} max (@var{a},@var{b})
%! @anchor{@dynDates/gt} %! @anchor{@dynDate/gt}
%! @sp 1 %! @sp 1
%! Overloads the max function for the Dynare dates class @ref{dynDates}. %! Overloads the max function for the Dynare dates class @ref{dynDate}.
%! @sp 2 %! @sp 2
%! @strong{Inputs} %! @strong{Inputs}
%! @sp 1 %! @sp 1
%! @table @ @var %! @table @ @var
%! @item a %! @item a
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @item b %! @item b
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @end table %! @end table
%! @sp 1 %! @sp 1
%! @strong{Outputs} %! @strong{Outputs}
%! @sp 1 %! @sp 1
%! @table @ @var %! @table @ @var
%! @item c %! @item c
%! Dynare date object instantiated by @ref{dynDates}. @var{c} is a copy of @var{a} if @var{a}>=@var{b}, a copy of @var{b} otherwise. %! Dynare date object instantiated by @ref{dynDate}. @var{c} is a copy of @var{a} if @var{a}>=@var{b}, a copy of @var{b} otherwise.
%! @end table %! @end table
%! @sp 2 %! @sp 2
%! @strong{This function is called by:} %! @strong{This function is called by:}
@ -50,15 +50,15 @@ function c = max(a,b)
verbose = 0; verbose = 0;
if nargin~=2 if nargin~=2
error('dynDates::min: I need exactly two input arguments!') error('dynDate::min: I need exactly two input arguments!')
end end
if ~( isa(a,'dynDates') && isa(b,'dynDates')) if ~( isa(a,'dynDate') && isa(b,'dynDate'))
error(['dynDates::min: Input arguments ' inputname(1) 'and ' inputname(2) ' have to be a dynDates objects!']) error(['dynDate::min: Input arguments ' inputname(1) 'and ' inputname(2) ' have to be a dynDate objects!'])
end end
if verbose && a.freq~=b.freq if verbose && a.freq~=b.freq
error(['dynDates::min: Input arguments ' inputname(1) 'and ' inputname(2) ' have no common frequencies!']) error(['dynDate::min: Input arguments ' inputname(1) 'and ' inputname(2) ' have no common frequencies!'])
end end
if a>=b if a>=b
@ -79,12 +79,12 @@ end
%$ date_6 = '1948M6'; %$ date_6 = '1948M6';
%$ %$
%$ % Call the tested routine. %$ % Call the tested routine.
%$ d1 = dynDates(date_1); %$ d1 = dynDate(date_1);
%$ d2 = dynDates(date_2); %$ d2 = dynDate(date_2);
%$ d3 = dynDates(date_3); %$ d3 = dynDate(date_3);
%$ d4 = dynDates(date_4); %$ d4 = dynDate(date_4);
%$ d5 = dynDates(date_5); %$ d5 = dynDate(date_5);
%$ d6 = dynDates(date_6); %$ d6 = dynDate(date_6);
%$ m1 = max(d1,d2); %$ m1 = max(d1,d2);
%$ i1 = (m1==d2); %$ i1 = (m1==d2);
%$ m2 = max(d3,d4); %$ m2 = max(d3,d4);

View File

@ -2,24 +2,24 @@ function c = min(a,b)
%@info: %@info:
%! @deftypefn {Function File} {@var{c} =} min (@var{a},@var{b}) %! @deftypefn {Function File} {@var{c} =} min (@var{a},@var{b})
%! @anchor{@dynDates/gt} %! @anchor{@dynDate/gt}
%! @sp 1 %! @sp 1
%! Overloads the min function for the Dynare dates class (@ref{dynDates}). %! Overloads the min function for the Dynare dates class (@ref{dynDate}).
%! @sp 2 %! @sp 2
%! @strong{Inputs} %! @strong{Inputs}
%! @sp 1 %! @sp 1
%! @table @ @var %! @table @ @var
%! @item a %! @item a
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @item b %! @item b
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @end table %! @end table
%! @sp 1 %! @sp 1
%! @strong{Outputs} %! @strong{Outputs}
%! @sp 1 %! @sp 1
%! @table @ @var %! @table @ @var
%! @item c %! @item c
%! Dynare date object instantiated by @ref{dynDates}. @var{c} is a copy of @var{a} if @var{a}<=@var{b}, a copy of @var{b} otherwise. %! Dynare date object instantiated by @ref{dynDate}. @var{c} is a copy of @var{a} if @var{a}<=@var{b}, a copy of @var{b} otherwise.
%! @end table %! @end table
%! @sp 2 %! @sp 2
%! @strong{This function is called by:} %! @strong{This function is called by:}
@ -50,15 +50,15 @@ function c = min(a,b)
verbose = 0; verbose = 0;
if nargin~=2 if nargin~=2
error('dynDates::min: I need exactly two input arguments!') error('dynDate::min: I need exactly two input arguments!')
end end
if ~( isa(a,'dynDates') && isa(b,'dynDates')) if ~( isa(a,'dynDate') && isa(b,'dynDate'))
error(['dynDates::min: Input arguments ' inputname(1) 'and ' inputname(2) ' have to be a dynDates objects!']) error(['dynDate::min: Input arguments ' inputname(1) 'and ' inputname(2) ' have to be a dynDate objects!'])
end end
if verbose && a.freq~=b.freq if verbose && a.freq~=b.freq
error(['dynDates::min: Input arguments ' inputname(1) 'and ' inputname(2) ' have no common frequencies!']) error(['dynDate::min: Input arguments ' inputname(1) 'and ' inputname(2) ' have no common frequencies!'])
end end
if a<=b if a<=b
@ -79,12 +79,12 @@ end
%$ date_6 = '1948M6'; %$ date_6 = '1948M6';
%$ %$
%$ % Call the tested routine. %$ % Call the tested routine.
%$ d1 = dynDates(date_1); %$ d1 = dynDate(date_1);
%$ d2 = dynDates(date_2); %$ d2 = dynDate(date_2);
%$ d3 = dynDates(date_3); %$ d3 = dynDate(date_3);
%$ d4 = dynDates(date_4); %$ d4 = dynDate(date_4);
%$ d5 = dynDates(date_5); %$ d5 = dynDate(date_5);
%$ d6 = dynDates(date_6); %$ d6 = dynDate(date_6);
%$ m1 = min(d1,d2); %$ m1 = min(d1,d2);
%$ i1 = (m1==d1); %$ i1 = (m1==d1);
%$ m2 = min(d3,d4); %$ m2 = min(d3,d4);

View File

@ -2,18 +2,18 @@ function c = minus(a,b)
%@info: %@info:
%! @deftypefn {Function File} {@var{c} =} minus (@var{a},@var{b}) %! @deftypefn {Function File} {@var{c} =} minus (@var{a},@var{b})
%! @anchor{@dynDates/minus} %! @anchor{@dynDate/minus}
%! @sp 1 %! @sp 1
%! Overloads the minus (soustraction) operator for the Dynare dates class (@ref{dynDates}). Depending on the frequency, computes the number %! Overloads the minus (soustraction) operator for the Dynare dates class (@ref{dynDate}). Depending on the frequency, computes the number
%! of years, quarters, months, weeks between two dates @var{a} and @var{b} (it is assumed that @var{a}>@var{B}). %! of years, quarters, months, weeks between two dates @var{a} and @var{b} (it is assumed that @var{a}>@var{B}).
%! @sp 2 %! @sp 2
%! @strong{Inputs} %! @strong{Inputs}
%! @sp 1 %! @sp 1
%! @table @ @var %! @table @ @var
%! @item a %! @item a
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @item b %! @item b
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @end table %! @end table
%! @sp 1 %! @sp 1
%! @strong{Outputs} %! @strong{Outputs}
@ -26,7 +26,7 @@ function c = minus(a,b)
%! @strong{This function is called by:} %! @strong{This function is called by:}
%! @sp 2 %! @sp 2
%! @strong{This function calls:} %! @strong{This function calls:}
%! @ref{@@dynDates/eq},@ref{@@dynDates/lt} %! @ref{@@dynDate/eq},@ref{@@dynDate/lt}
%! %!
%! @end deftypefn %! @end deftypefn
%@eod: %@eod:
@ -49,16 +49,16 @@ function c = minus(a,b)
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>. % along with Dynare. If not, see <http://www.gnu.org/licenses/>.
if ~( isa(a,'dynDates') && isa(b,'dynDates') ) if ~( isa(a,'dynDate') && isa(b,'dynDate') )
error(['dynDates::minus: Input arguments ' inputname(1) ' and ' inputname(2) ' must be dynDates objects!']) error(['dynDate::minus: Input arguments ' inputname(1) ' and ' inputname(2) ' must be dynDate objects!'])
end end
if a.freq~=b.freq if a.freq~=b.freq
error(['dynDates::minus: ' inputname(1) ' and ' inputname(2) ' must have common frequency!']) error(['dynDate::minus: ' inputname(1) ' and ' inputname(2) ' must have common frequency!'])
end end
if a<b if a<b
error(['dynDates::minus: ' inputname(1) ' must be posterior to ' inputname(2) '!']) error(['dynDate::minus: ' inputname(1) ' must be posterior to ' inputname(2) '!'])
end end
if a==b if a==b
@ -72,7 +72,7 @@ switch a.freq
case {4,12,52} case {4,12,52}
c = a.time(2)-b.time(2) + (a.time(1)-b.time(1))*a.freq; c = a.time(2)-b.time(2) + (a.time(1)-b.time(1))*a.freq;
otherwise otherwise
error('dynDates::minus: Unknown frequency!') error('dynDate::minus: Unknown frequency!')
end end
%@test:1 %@test:1
@ -89,14 +89,14 @@ end
%$ date_2_2 = '1998M8'; %$ date_2_2 = '1998M8';
%$ %$
%$ % Call the tested routine. %$ % Call the tested routine.
%$ d_0_1 = dynDates(date_0_1); %$ d_0_1 = dynDate(date_0_1);
%$ d_0_2 = dynDates(date_0_2); %$ d_0_2 = dynDate(date_0_2);
%$ d_0_3 = dynDates(date_0_3); %$ d_0_3 = dynDate(date_0_3);
%$ d_1_1 = dynDates(date_1_1); %$ d_1_1 = dynDate(date_1_1);
%$ d_1_2 = dynDates(date_1_2); %$ d_1_2 = dynDate(date_1_2);
%$ d_1_3 = dynDates(date_1_3); %$ d_1_3 = dynDate(date_1_3);
%$ d_2_1 = dynDates(date_2_1); %$ d_2_1 = dynDate(date_2_1);
%$ d_2_2 = dynDates(date_2_2); %$ d_2_2 = dynDate(date_2_2);
%$ e1 = d_0_1-d_0_2; %$ e1 = d_0_1-d_0_2;
%$ e2 = d_0_1-d_0_3; %$ e2 = d_0_1-d_0_3;
%$ e3 = d_1_1-d_1_2; %$ e3 = d_1_1-d_1_2;

View File

@ -2,17 +2,17 @@ function c = ne(a,b)
%@info: %@info:
%! @deftypefn {Function File} {@var{c} =} ne (@var{a},@var{b}) %! @deftypefn {Function File} {@var{c} =} ne (@var{a},@var{b})
%! @anchor{@dynDates/ne} %! @anchor{@dynDate/ne}
%! @sp 1 %! @sp 1
%! Overloads the ne (not equal) operator for the Dynare dates class (@ref{dynDates}). %! Overloads the ne (not equal) operator for the Dynare dates class (@ref{dynDate}).
%! @sp 2 %! @sp 2
%! @strong{Inputs} %! @strong{Inputs}
%! @sp 1 %! @sp 1
%! @table @ @var %! @table @ @var
%! @item a %! @item a
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @item b %! @item b
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @end table %! @end table
%! @sp 1 %! @sp 1
%! @strong{Outputs} %! @strong{Outputs}
@ -50,15 +50,15 @@ function c = ne(a,b)
verbose = 0; verbose = 0;
if nargin~=2 if nargin~=2
error('dynDates::ne: I need exactly two input arguments!') error('dynDate::ne: I need exactly two input arguments!')
end end
if ~( isa(a,'dynDates') && isa(b,'dynDates')) if ~( isa(a,'dynDate') && isa(b,'dynDate'))
error(['dynDates::ne: Input arguments ' inputname(1) 'and ' inputname(2) ' have to be a dynDates objects!']) error(['dynDate::ne: Input arguments ' inputname(1) 'and ' inputname(2) ' have to be a dynDate objects!'])
end end
if verbose && a.freq~=b.freq if verbose && a.freq~=b.freq
disp(['dynDates::ne: Input arguments ' inputname(1) 'and ' inputname(2) ' have no common frequencies!']) disp(['dynDate::ne: Input arguments ' inputname(1) 'and ' inputname(2) ' have no common frequencies!'])
c = 1; c = 1;
end end
@ -75,11 +75,11 @@ c = ~isequal(a.time,b.time);
%$ date_5 = '1950W32'; %$ date_5 = '1950W32';
%$ %$
%$ % Call the tested routine. %$ % Call the tested routine.
%$ d1 = dynDates(date_1); %$ d1 = dynDate(date_1);
%$ d2 = dynDates(date_2); %$ d2 = dynDate(date_2);
%$ d3 = dynDates(date_3); %$ d3 = dynDate(date_3);
%$ d4 = dynDates(date_4); %$ d4 = dynDate(date_4);
%$ d5 = dynDates(date_5); %$ d5 = dynDate(date_5);
%$ i1 = (d1~=d2); %$ i1 = (d1~=d2);
%$ i2 = (d2~=d2); %$ i2 = (d2~=d2);
%$ i3 = (d4~=d5); %$ i3 = (d4~=d5);

View File

@ -2,16 +2,16 @@ function c = plus(a,b)
%@info: %@info:
%! @deftypefn {Function File} {@var{c} =} plus (@var{a},@var{b}) %! @deftypefn {Function File} {@var{c} =} plus (@var{a},@var{b})
%! @anchor{@dynDates/plus} %! @anchor{@dynDate/plus}
%! @sp 1 %! @sp 1
%! Overloads the plus (addition) operator for the Dynare dates class (@ref{dynDates}). Given an initial date @var{a}, %! Overloads the plus (addition) operator for the Dynare dates class (@ref{dynDate}). Given an initial date @var{a},
%! computes a new date @var{c} by adding the number of periods @var{b}. %! computes a new date @var{c} by adding the number of periods @var{b}.
%! @sp 2 %! @sp 2
%! @strong{Inputs} %! @strong{Inputs}
%! @sp 1 %! @sp 1
%! @table @ @var %! @table @ @var
%! @item a %! @item a
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @item b %! @item b
%! Positive scalar integer, the number of periods %! Positive scalar integer, the number of periods
%! @end table %! @end table
@ -20,13 +20,13 @@ function c = plus(a,b)
%! @sp 1 %! @sp 1
%! @table @ @var %! @table @ @var
%! @item c %! @item c
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @end table %! @end table
%! @sp 2 %! @sp 2
%! @strong{This function is called by:} %! @strong{This function is called by:}
%! @sp 2 %! @sp 2
%! @strong{This function calls:} %! @strong{This function calls:}
%! @ref{@@dynDates/eq} %! @ref{@@dynDate/eq}
%! %!
%! @end deftypefn %! @end deftypefn
%@eod: %@eod:
@ -50,12 +50,12 @@ function c = plus(a,b)
% AUTHORS(S) stephane DOT adjemian AT univ DASH lemans DOT fr % AUTHORS(S) stephane DOT adjemian AT univ DASH lemans DOT fr
if ~isa(a,'dynDates') if ~isa(a,'dynDate')
error(['dynDates::plus: Input argument ' inputname(1) ' must be a dynDates object!']) error(['dynDate::plus: Input argument ' inputname(1) ' must be a dynDate object!'])
end end
if b<0 || ~isint(b) if b<0 || ~isint(b)
error(['dynDates::plus: Input argument ' inputname(2) ' must be a positive integer']) error(['dynDate::plus: Input argument ' inputname(2) ' must be a positive integer'])
end end
@ -76,7 +76,7 @@ switch a.freq
c.time(2) = c.time(2)+n3-1; c.time(2) = c.time(2)+n3-1;
c.time(1) = c.time(1)+n2; c.time(1) = c.time(1)+n2;
otherwise otherwise
error('dynDates::plus: Unknown frequency!') error('dynDate::plus: Unknown frequency!')
end end
%@test:1 %@test:1
@ -88,9 +88,9 @@ end
%$ date_3 = '2000M3'; %$ date_3 = '2000M3';
%$ %$
%$ % Call the tested routine. %$ % Call the tested routine.
%$ d_1 = dynDates(date_1); %$ d_1 = dynDate(date_1);
%$ d_2 = dynDates(date_2); %$ d_2 = dynDate(date_2);
%$ d_3 = dynDates(date_3); %$ d_3 = dynDate(date_3);
%$ %$
%$ d1 = d_1+3; %$ d1 = d_1+3;
%$ d2 = d_2+5; %$ d2 = d_2+5;
@ -98,10 +98,10 @@ end
%$ d4 = d_3+10; %$ d4 = d_3+10;
%$ %$
%$ % Expected results. %$ % Expected results.
%$ e1 = dynDates(1952); %$ e1 = dynDate(1952);
%$ e2 = dynDates('1951Q4'); %$ e2 = dynDate('1951Q4');
%$ e3 = dynDates('2001M5'); %$ e3 = dynDate('2001M5');
%$ e4 = dynDates('2000M12'); %$ e4 = dynDate('2000M12');
%$ %$
%$ % Check the results. %$ % Check the results.
%$ t(1) = dyn_assert(e1.time,d1.time); %$ t(1) = dyn_assert(e1.time,d1.time);

View File

@ -2,15 +2,15 @@ function B = subsref(A,S)
%@info: %@info:
%! @deftypefn {Function File} {@var{us} =} subsref (@var{ts},S) %! @deftypefn {Function File} {@var{us} =} subsref (@var{ts},S)
%! @anchor{@dynDates/subsref} %! @anchor{@dynDate/subsref}
%! @sp 1 %! @sp 1
%! Overloads the subsref method for the Dynare dates class (@ref{dynDates}). %! Overloads the subsref method for the Dynare dates class (@ref{dynDate}).
%! @sp 2 %! @sp 2
%! @strong{Inputs} %! @strong{Inputs}
%! @sp 1 %! @sp 1
%! @table @ @var %! @table @ @var
%! @item A %! @item A
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @item S %! @item S
%! Matlab's structure array S with two fields, type and subs. The type field is string containing '()', '@{@}', or '.', where '()' specifies %! Matlab's structure array S with two fields, type and subs. The type field is string containing '()', '@{@}', or '.', where '()' specifies
%! integer subscripts, '@{@}' specifies cell array subscripts, and '.' specifies subscripted structure fields. The subs field is a cell array %! integer subscripts, '@{@}' specifies cell array subscripts, and '.' specifies subscripted structure fields. The subs field is a cell array
@ -21,7 +21,7 @@ function B = subsref(A,S)
%! @sp 1 %! @sp 1
%! @table @ @var %! @table @ @var
%! @item B %! @item B
%! A matlab object (public member of the @ref{dynDates} object). %! A matlab object (public member of the @ref{dynDate} object).
%! @end table %! @end table
%! @sp 2 %! @sp 2
%! @strong{This function is called by:} %! @strong{This function is called by:}

View File

@ -2,29 +2,29 @@ function b = uminus(a)
%@info: %@info:
%! @deftypefn {Function File} {@var{b} =} uminus (@var{a}) %! @deftypefn {Function File} {@var{b} =} uminus (@var{a})
%! @anchor{@dynDates/uplus} %! @anchor{@dynDate/uplus}
%! @sp 1 %! @sp 1
%! Overloads the uminus (unary soustraction) operator for the Dynare dates class (@ref{dynDates}). Decrement the date by one year, quarter, %! Overloads the uminus (unary soustraction) operator for the Dynare dates class (@ref{dynDate}). Decrement the date by one year, quarter,
%! month or week depending on the frequency. %! month or week depending on the frequency.
%! @sp 2 %! @sp 2
%! @strong{Inputs} %! @strong{Inputs}
%! @sp 1 %! @sp 1
%! @table @ @var %! @table @ @var
%! @item a %! @item a
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @end table %! @end table
%! @sp 1 %! @sp 1
%! @strong{Outputs} %! @strong{Outputs}
%! @sp 1 %! @sp 1
%! @table @ @var %! @table @ @var
%! @item b %! @item b
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @end table %! @end table
%! @sp 2 %! @sp 2
%! @strong{This function is called by:} %! @strong{This function is called by:}
%! @sp 2 %! @sp 2
%! @strong{This function calls:} %! @strong{This function calls:}
%! @ref{dynDates} %! @ref{dynDate}
%! %!
%! @end deftypefn %! @end deftypefn
%@eod: %@eod:
@ -47,11 +47,11 @@ function b = uminus(a)
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>. % along with Dynare. If not, see <http://www.gnu.org/licenses/>.
if ~isa(a,'dynDates') if ~isa(a,'dynDate')
error(['dynDates::uminus: Input argument ' inputname(1) ' must be a dynDates object.']) error(['dynDate::uminus: Input argument ' inputname(1) ' must be a dynDate object.'])
end end
b = dynDates(a); b = dynDate(a);
switch b.freq switch b.freq
case 1 case 1
@ -78,7 +78,7 @@ switch b.freq
b.time(2) = b.time(2)-1; b.time(2) = b.time(2)-1;
end end
otherwise otherwise
error('dynDates::minus: Unknown frequency!') error('dynDate::minus: Unknown frequency!')
end end
%@test:1 %@test:1
@ -94,13 +94,13 @@ end
%$ date_7 = 2000; %$ date_7 = 2000;
%$ %$
%$ % Call the tested routine. %$ % Call the tested routine.
%$ d1 = dynDates(date_1); %$ d1 = dynDate(date_1);
%$ d2 = dynDates(date_2); %$ d2 = dynDate(date_2);
%$ d3 = dynDates(date_3); %$ d3 = dynDate(date_3);
%$ d4 = dynDates(date_4); %$ d4 = dynDate(date_4);
%$ d5 = dynDates(date_5); %$ d5 = dynDate(date_5);
%$ d6 = dynDates(date_6); %$ d6 = dynDate(date_6);
%$ d7 = dynDates(date_7); %$ d7 = dynDate(date_7);
%$ e1 = -d1; %$ e1 = -d1;
%$ e2 = -d2; %$ e2 = -d2;
%$ e3 = -d3; %$ e3 = -d3;

View File

@ -2,29 +2,29 @@ function b = uplus(a)
%@info: %@info:
%! @deftypefn {Function File} {@var{b} =} uplus (@var{a}) %! @deftypefn {Function File} {@var{b} =} uplus (@var{a})
%! @anchor{@dynDates/uplus} %! @anchor{@dynDate/uplus}
%! @sp 1 %! @sp 1
%! Overloads the uplus (unary addition) operator for the Dynare dates class (@ref{dynDates}). Increment the date by one year, quarter, %! Overloads the uplus (unary addition) operator for the Dynare dates class (@ref{dynDate}). Increment the date by one year, quarter,
%! month or week depending on the frequency. %! month or week depending on the frequency.
%! @sp 2 %! @sp 2
%! @strong{Inputs} %! @strong{Inputs}
%! @sp 1 %! @sp 1
%! @table @ @var %! @table @ @var
%! @item a %! @item a
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @end table %! @end table
%! @sp 1 %! @sp 1
%! @strong{Outputs} %! @strong{Outputs}
%! @sp 1 %! @sp 1
%! @table @ @var %! @table @ @var
%! @item b %! @item b
%! Dynare date object instantiated by @ref{dynDates}. %! Dynare date object instantiated by @ref{dynDate}.
%! @end table %! @end table
%! @sp 2 %! @sp 2
%! @strong{This function is called by:} %! @strong{This function is called by:}
%! @sp 2 %! @sp 2
%! @strong{This function calls:} %! @strong{This function calls:}
%! @ref{dynDates} %! @ref{dynDate}
%! %!
%! @end deftypefn %! @end deftypefn
%@eod: %@eod:
@ -47,11 +47,11 @@ function b = uplus(a)
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>. % along with Dynare. If not, see <http://www.gnu.org/licenses/>.
if ~isa(a,'dynDates') if ~isa(a,'dynDate')
error(['dynDates::uplus: Input argument ' inputname(1) ' must be a dynDates object.']) error(['dynDate::uplus: Input argument ' inputname(1) ' must be a dynDate object.'])
end end
b = dynDates(a); b = dynDate(a);
switch b.freq switch b.freq
case 1 case 1
@ -78,7 +78,7 @@ switch b.freq
b.time(2) = b.time(2)+1; b.time(2) = b.time(2)+1;
end end
otherwise otherwise
error('dynDates::uplus: Unknown frequency!') error('dynDate::uplus: Unknown frequency!')
end end
%@test:1 %@test:1
@ -94,13 +94,13 @@ end
%$ date_7 = 2000; %$ date_7 = 2000;
%$ %$
%$ % Call the tested routine. %$ % Call the tested routine.
%$ d1 = dynDates(date_1); %$ d1 = dynDate(date_1);
%$ d2 = dynDates(date_2); %$ d2 = dynDate(date_2);
%$ d3 = dynDates(date_3); %$ d3 = dynDate(date_3);
%$ d4 = dynDates(date_4); %$ d4 = dynDate(date_4);
%$ d5 = dynDates(date_5); %$ d5 = dynDate(date_5);
%$ d6 = dynDates(date_6); %$ d6 = dynDate(date_6);
%$ d7 = dynDates(date_7); %$ d7 = dynDate(date_7);
%$ e1 = +d1; %$ e1 = +d1;
%$ e2 = +d2; %$ e2 = +d2;
%$ e3 = +d3; %$ e3 = +d3;

View File

@ -131,7 +131,7 @@ switch nargin
ts.freq = 1; ts.freq = 1;
end end
ts.Time = ts.Time.setFreq(ts.freq); ts.Time = ts.Time.setFreq(ts.freq);
ts.Time = ts.Time.setTime(dynDates(b):dynDates(b)+ts.nobs); ts.Time = ts.Time.setTime(dynDate(b):dynDate(b)+ts.nobs);
else% If b is empty. else% If b is empty.
ts.freq = 1; ts.freq = 1;
ts.Time = ts.Time.setFreq(1); ts.Time = ts.Time.setFreq(1);