diff --git a/src/@dates/append.m b/src/@dates/append.m index 67ac93c13979ef16b64ca6d7af98a964743186bc..fcdb5286f8acbcea3f97d2bdddfe42783a60bd5f 100644 --- a/src/@dates/append.m +++ b/src/@dates/append.m @@ -2,15 +2,15 @@ function B = append(A,a) % --*-- Unitary tests --*-- % append method for dates class. % -% INPUTS +% INPUTS % o A dates object. % o a dates object with one element or string that can be interpreted as a date. % -% OUTPUTS +% OUTPUTS % o B dates object containing dates defined in A and a. % -% EXAMPLE 1 -% If A is a dates object with quarterly frequency, then B = A.append(dates('1950Q2')) and +% EXAMPLE 1 +% If A is a dates object with quarterly frequency, then B = A.append(dates('1950Q2')) and % B = A.append('1950Q2') are equivalent syntaxes. % Copyright (C) 2012-2013 Dynare Team @@ -51,7 +51,7 @@ B.ndat = A.ndat+1; B.freq = A.freq; B.time = NaN(B.ndat,2); B.time(1:A.ndat,:) = A.time; -B.time(A.ndat+1,:) = a.time; +B.time(A.ndat+1,:) = a.time; %@test:1 %$ % Define some dates diff --git a/src/@dates/char.m b/src/@dates/char.m index bdde032dc39e4353ee21c3e48c99bbdc07fcafe9..8efc29456265b2c06558cdaf0f10de45b793d673 100644 --- a/src/@dates/char.m +++ b/src/@dates/char.m @@ -2,7 +2,7 @@ function s = char(dd) % Given a one element dates object, returns a string with the formatted date. % -% INPUTS +% INPUTS % o dd dates object with one element % % OUTPUTS diff --git a/src/@dates/colon.m b/src/@dates/colon.m index 218a9f8db62d54737bd8a363fab5db56322336ab..162c95d13242bbbeedc026c0e374bc3d52ff8721 100644 --- a/src/@dates/colon.m +++ b/src/@dates/colon.m @@ -2,15 +2,15 @@ function C = colon(varargin) % --*-- Unitary tests --*-- % Overloads the colon operator (:). This method can be used to create ranges of dates. % -% INPUTS +% INPUTS % o A dates object with one element. % o d integer scalar, number of periods between each date (default value, if nargin==2, is one) % o B dates object with one element. % -% OUTPUTS +% OUTPUTS % o C dates object with length(B-A) elements (if d==1). % -% REMARKS +% REMARKS % B must be greater than A if d>0. % Copyright (C) 2013 Dynare Team diff --git a/src/@dates/disp.m b/src/@dates/disp.m index 9c012fea451cf02dd3ccd9234cb116fba74d43d8..976b1495a738981a340eda0732293520b5634139 100644 --- a/src/@dates/disp.m +++ b/src/@dates/disp.m @@ -21,12 +21,12 @@ if isempty(dd) fprintf('Empty dates object.\n'); return end - + max_displayed = 5; first_displayed = 2; - + fprintf('<dates: '); - + if dd.ndat<=max_displayed for i=1:dd.ndat fprintf(date2string(dd.time(i,:),dd.freq)) diff --git a/src/@dates/display.m b/src/@dates/display.m index 2d230dc8510fd4e828228f4b102b287699e81f52..da9fac53d18986c3cb0dd0fc1777ab5df84e047f 100644 --- a/src/@dates/display.m +++ b/src/@dates/display.m @@ -24,7 +24,7 @@ end max_displayed = 5; first_displayed = 2; - + fprintf('%s = <dates: ', inputname(1)); if dd.ndat<=max_displayed diff --git a/src/@dates/double.m b/src/@dates/double.m index c991889c38df632d339846c0e57c9c0b644518aa..be3aabac6ebb021b59c5c8855b22beaf28a8e326 100644 --- a/src/@dates/double.m +++ b/src/@dates/double.m @@ -3,16 +3,16 @@ function [B, C] = double(A) % --*-- Unitary tests --*-- % Returns a vector of doubles with the fractional part corresponding % to the subperiod. Used for plots and to store dates in a matrix. % -% INPUTS +% INPUTS % o A dates object. % -% OUTPUTS +% OUTPUTS % o B A.ndat*1 vector of doubles. % o C integer scalar, the frequency (1, 4, 12 or 52). % -% REMARKS +% REMARKS % Obviously the frequency is lost during the conversion. - + % Copyright (C) 2013 Dynare Team % % This file is part of Dynare. diff --git a/src/@dates/eq.m b/src/@dates/eq.m index 4f5b7f6dec4d18a9f5d24e7d00ca4a1703b9b967..105db95dce3b37e29747f582ed68a956dc31b79a 100644 --- a/src/@dates/eq.m +++ b/src/@dates/eq.m @@ -2,11 +2,11 @@ function C = eq(A,B) % --*-- Unitary tests --*-- % Overloads == operator for dates objects. % -% INPUTS +% INPUTS % o A dates object with n or 1 elements. % o B dates object with n or 1 elements. % -% OUTPUTS +% OUTPUTS % o C column vector of max(n,1) elements (zeros or ones). % Copyright (C) 2013 Dynare Team diff --git a/src/@dates/ge.m b/src/@dates/ge.m index 6593bc1910b38b14186d74449a6ee94015913be1..c828303e64b01dbf26bdbc8693e898a6e6ab279e 100644 --- a/src/@dates/ge.m +++ b/src/@dates/ge.m @@ -2,11 +2,11 @@ function C = ge(A,B) % --*-- Unitary tests --*-- % Overloads the >= operator for dates objects. % -% INPUTS +% INPUTS % o A dates object with n or 1 elements. % o B dates object with n or 1 elements. % -% OUTPUTS +% OUTPUTS % o C column vector of max(n,1) elements (zeros or ones). % Copyright (C) 2013 Dynare Team @@ -63,19 +63,19 @@ end function c = greaterorequal(a,b) - if a(1)>b(1) - c = true; +if a(1)>b(1) + c = true; +else + if a(1)<b(1) + c = false; else - if a(1)<b(1) - c = false; + if a(2)>=b(2) + c = true; else - if a(2)>=b(2) - c = true; - else - c = false; - end + c = false; end end +end %@test:1 @@ -94,7 +94,7 @@ function c = greaterorequal(a,b) %$ i2 = (d3>=d4); %$ i3 = (d4>=d2); %$ i4 = (d5>=d4); -%$ i5 = (d5>=d5); +%$ i5 = (d5>=d5); %$ %$ % Check the results. %$ t(1) = dassert(i1,false); diff --git a/src/@dates/gt.m b/src/@dates/gt.m index fbf36fbf369cfc3a160ab49cb3a7b5c261c52e82..6df782c2da5b4d5264d72a44438cfa8c7ff6254f 100644 --- a/src/@dates/gt.m +++ b/src/@dates/gt.m @@ -2,11 +2,11 @@ function C = gt(A,B) % --*-- Unitary tests --*-- % Overloads the > operator for dates objects. % -% INPUTS +% INPUTS % o A dates object with n or 1 elements. % o B dates object with n or 1 elements. % -% OUTPUTS +% OUTPUTS % o C column vector of max(n,1) elements (zeros or ones). % Copyright (C) 2013 Dynare Team @@ -62,19 +62,19 @@ end function c = greaterthan(a,b) - if a(1)>b(1) - c = true; +if a(1)>b(1) + c = true; +else + if a(1)<b(1) + c = false; else - if a(1)<b(1) - c = false; + if a(2)>b(2) + c = true; else - if a(2)>b(2) - c = true; - else - c = false; - end + c = false; end end +end %@test:1 %$ % Define some dates diff --git a/src/@dates/horzcat.m b/src/@dates/horzcat.m index ed00e1f8d3a88c384095a154e57af44234a93771..c9e4c45ef6402bc4aded75fd959013148fb826fb 100644 --- a/src/@dates/horzcat.m +++ b/src/@dates/horzcat.m @@ -2,21 +2,21 @@ function B = horzcat(varargin) % --*-- Unitary tests --*-- % Overloads the horzcat method for dates objects. % -% INPUTS +% INPUTS % o A1 dates object. % o A2 dates object. % o ... % -% OUTPUTS +% OUTPUTS % o B dates object containing dates defined in A1, A2, ... % -% EXAMPLE 1 +% EXAMPLE 1 % If A, B and C are dates objects the following syntax: -% +% % D = [A, B, C] ; % % Defines a dates object D containing the dates appearing in A, B and C. - + % Copyright (C) 2013-2017 Dynare Team % % This file is part of Dynare. diff --git a/src/@dates/intersect.m b/src/@dates/intersect.m index dd2ef9b00c13975ebe0341a9b3f9681591332946..294b2c09bfbedaf10c7c3c50f02424fd9335ba06 100644 --- a/src/@dates/intersect.m +++ b/src/@dates/intersect.m @@ -69,7 +69,7 @@ end C.freq = A.freq; C.time = time; -C.ndat = rows(time); +C.ndat = rows(time); %@test:1 %$ % Define some dates objects diff --git a/src/@dates/isempty.m b/src/@dates/isempty.m index 859f7a785ed3e8a364d9a8e07e2b175a3cf6422b..bc731f9b19b4f9a6e67f6f94ef60990e6cb40ecb 100644 --- a/src/@dates/isempty.m +++ b/src/@dates/isempty.m @@ -38,7 +38,7 @@ function B = isempty(A) % --*-- Unitary tests --*-- % % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>. - + B = isequal(A.ndat,0); %@test:1 diff --git a/src/@dates/le.m b/src/@dates/le.m index 031f424597c358dce0e10b5a45276eae879b321a..58b094b46e1f2d4fcec9e27d549d61cb2982d942 100644 --- a/src/@dates/le.m +++ b/src/@dates/le.m @@ -2,11 +2,11 @@ function C = le(A,B) % --*-- Unitary tests --*-- % Overloads the <= operator for dates objects. % -% INPUTS +% INPUTS % o A dates object with n or 1 elements. % o B dates object with n or 1 elements. % -% OUTPUTS +% OUTPUTS % o C column vector of max(n,1) elements (zeros or ones). % Copyright (C) 2013 Dynare Team @@ -63,19 +63,19 @@ end function c = lessorequal(a, b) - if a(1)<b(1) - c = true; +if a(1)<b(1) + c = true; +else + if a(1)>b(1) + c = false; else - if a(1)>b(1) - c = false; + if a(2)<=b(2) + c = true; else - if a(2)<=b(2) - c = true; - else - c = false; - end + c = false; end end +end %@test:1 diff --git a/src/@dates/lt.m b/src/@dates/lt.m index 86097a6f5a35a1a7325a38504c59b3a50ad6fb39..e829348c65deb2f9a5324328e46e7b97978b96fa 100644 --- a/src/@dates/lt.m +++ b/src/@dates/lt.m @@ -2,11 +2,11 @@ function C = lt(A,B) % --*-- Unitary tests --*-- % Overloads the < operator for dates objects. % -% INPUTS +% INPUTS % o A dates object with n or 1 elements. % o B dates object with n or 1 elements. % -% OUTPUTS +% OUTPUTS % o C column vector of max(n,1) elements (zeros or ones). % Copyright (C) 2013 Dynare Team @@ -61,19 +61,19 @@ else end function c = lessthan(a,b) - if a(1)<b(1) - c = true; +if a(1)<b(1) + c = true; +else + if a(1)>b(1) + c = false; else - if a(1)>b(1) - c = false; + if a(2)<b(2) + c = true; else - if a(2)<b(2) - c = true; - else - c = false; - end + c = false; end end +end %@test:1 %$ % Define some dates diff --git a/src/@dates/max.m b/src/@dates/max.m index fef48fed0786d410d3f8506e819b1c1f7fda97ee..b69654f17b82bb7ab1378e3d1cad64c4b5131de1 100644 --- a/src/@dates/max.m +++ b/src/@dates/max.m @@ -1,7 +1,7 @@ function C = max(varargin) - + % Overloads the max function for dates objects. - + % Copyright (C) 2013 Dynare Team % % This file is part of Dynare. diff --git a/src/@dates/min.m b/src/@dates/min.m index 5a2bd9d63c349e589f9e7976275b8a51fbbe291f..49e4b1258446ded288228a816d2e0554dce59428 100644 --- a/src/@dates/min.m +++ b/src/@dates/min.m @@ -1,7 +1,7 @@ function C = min(varargin) - + % Overloads the min function for dates objects. - + % Copyright (C) 2013 Dynare Team % % This file is part of Dynare. diff --git a/src/@dates/minus.m b/src/@dates/minus.m index 455efc0ad9ec3b0c20244fb311d786561afa0585..74d0f21035006bd696a39a2f4c4ead3fad9c9728 100644 --- a/src/@dates/minus.m +++ b/src/@dates/minus.m @@ -1,6 +1,6 @@ function C = minus(A,B) % --*-- Unitary tests --*-- -% Overloads the minus operator (-). If A and B are dates objects, the method returns the number of periods between A and B (so that A+C=B). If +% Overloads the minus operator (-). If A and B are dates objects, the method returns the number of periods between A and B (so that A+C=B). If % one of the inputs is an integer or a vector of integers, the method shifts the dates object by X (the interger input) periods backward. % Copyright (C) 2013 Dynare Team diff --git a/src/@dates/mtimes.m b/src/@dates/mtimes.m index 513915b3283f7210ce25f53063de36a56709c75f..843bd3bab87adf699a1727c2554b2ec6b436de5f 100644 --- a/src/@dates/mtimes.m +++ b/src/@dates/mtimes.m @@ -2,14 +2,14 @@ function B = mtimes(A,n) % Overloads the times operator (*). Returns dates object A replicated n times. % -% INPUTS +% INPUTS % o A dates object with m elements. % -% OUTPUTS +% OUTPUTS % o B dates object with m*n elements. % % EXAMPLE 1 -% If A = dates('2000Q1'), then B=A*3 is a dates object equal to dates('2000Q1','2000Q1','2000Q1') +% If A = dates('2000Q1'), then B=A*3 is a dates object equal to dates('2000Q1','2000Q1','2000Q1') % % EXAMPLE 2 % If A = dates('2003Q1','2009Q2'), then B=A*2 is a dates object equal to dates('2003Q1','2009Q2','2003Q1','2009Q2') diff --git a/src/@dates/ne.m b/src/@dates/ne.m index 0fdf4f8c9152d48f9eda598854b4f41d48bd542b..43787b5cd112ec9f30abaaaaab5a5d533a472f25 100644 --- a/src/@dates/ne.m +++ b/src/@dates/ne.m @@ -2,11 +2,11 @@ function C = ne(A,B) % --*-- Unitary tests --*-- % Overloads ~= operator for dates objects. % -% INPUTS +% INPUTS % o A dates object with n or 1 elements. % o B dates object with n or 1 elements. % -% OUTPUTS +% OUTPUTS % o C column vector of max(n,1) elements (zeros or ones). % Copyright (C) 2013 Dynare Team diff --git a/src/@dates/plus.m b/src/@dates/plus.m index b65fc3c0e911a11bc85c521e362a1d6b2b2d502e..82a0f1d6ce8c9f1bd62ca6e2e0841efa306cb64f 100644 --- a/src/@dates/plus.m +++ b/src/@dates/plus.m @@ -62,7 +62,7 @@ end %$ t(1) = 0; %$ end %$ -%$ if t(1) +%$ if t(1) %$ t(2) = dassert(e1,d3); %$ t(3) = dassert(e2,dates('1950Q1','1950Q2','1950Q3','1950Q4','1950Q1','1950Q2','1950Q3','1950Q4')); %$ end diff --git a/src/@dates/pop.m b/src/@dates/pop.m index 93b64a1a916005e59d649eeccfb98f40ebe020a8..240910f2c32c1227a8c2a340b3e6b6e1bd077d27 100644 --- a/src/@dates/pop.m +++ b/src/@dates/pop.m @@ -2,14 +2,14 @@ function B = pop(A,a) % --*-- Unitary tests --*-- % pop method for dates class (removes a date). % -% INPUTS +% INPUTS % o A dates object. % o a dates object with one element, string which can be interpreted as a date or integer scalar. % -% OUTPUTS +% OUTPUTS % o B dates object (with B.ndat==A.ndat-1). % -% REMARKS +% REMARKS % If a is a date appearing more than once in A, then only the last occurence is removed. If one wants to % remove all the occurences of a in A, the setdiff function should be used instead. diff --git a/src/@dates/setdiff.m b/src/@dates/setdiff.m index 1c3edab67f7721af3405f7701b2437f89902c404..09d4f3c5aa3173f8600ca61d5df8960109a96bc9 100644 --- a/src/@dates/setdiff.m +++ b/src/@dates/setdiff.m @@ -80,7 +80,7 @@ if isempty(time) end C.time = time; -C.ndat = rows(time); +C.ndat = rows(time); %@test:1 %$ % Define some dates objects diff --git a/src/@dates/sort.m b/src/@dates/sort.m index 0cb3c17d5e68cb572c366c03dc315e3df189a6f0..3ba17933c0f486bb8798fa14dc9a492d71efcf3e 100644 --- a/src/@dates/sort.m +++ b/src/@dates/sort.m @@ -2,10 +2,10 @@ function dd = sort(dd) % --*-- Unitary tests --*-- % Sort method for dates class. % -% INPUTS +% INPUTS % o dd dates object. % -% OUTPUTS +% OUTPUTS % o dd dates object (with dates sorted by increasing order). % Copyright (C) 2011-2013 Dynare Team @@ -46,7 +46,7 @@ dd.time = sortrows(dd.time,[1,2]); %$ % Call the tested routine. %$ d = dates(B1,B2,B3,B4); %$ d = d.sort; -%$ +%$ %$ % Check the results. %$ t(1) = dassert(d.time,e.time); %$ t(2) = dassert(d.freq,e.freq); diff --git a/src/@dates/strings.m b/src/@dates/strings.m index 94ccefa1129fe12e64bc4588ca2b4f1f9a0b10ec..f92b502924961128db5dc3d903d604be5e59eb4a 100644 --- a/src/@dates/strings.m +++ b/src/@dates/strings.m @@ -2,7 +2,7 @@ function m = strings(dd) % Returns a cell array of strings containing the dates % -% INPUTS +% INPUTS % o dd dates object % % OUTPUTS diff --git a/src/@dates/subsref.m b/src/@dates/subsref.m index 66de24798546c4a3e6ab47b77c954dede710c766..d919a7c5660dafd271ce1bb8a3625b4632dedf85 100644 --- a/src/@dates/subsref.m +++ b/src/@dates/subsref.m @@ -2,14 +2,14 @@ function B = subsref(A,S) % --*-- Unitary tests --*-- % Overload the subsref method for dates objects. % -% INPUTS +% INPUTS % o A dates object. % o S matlab's structure. % -% OUTPUTS +% OUTPUTS % o B dates object. % -% REMARKS +% REMARKS % See the matlab's documentation about the subsref method. % Copyright (C) 2011-2014 Dynare Team @@ -40,7 +40,7 @@ switch S(1).type case {'sort','unique','double','isempty','length','char'}% Public methods (without input arguments) B = feval(S(1).subs,A); if length(S)>1 && isequal(S(2).type,'()') && isempty(S(2).subs) - S = shiftS(S,1); + S = shiftS(S,1); end case {'append','pop'}% Public methods (with arguments). if isequal(S(2).type,'()') @@ -201,7 +201,7 @@ end %$ B = dates('1950Q1'):dates('1960Q3'); %$ %$ % Try to extract a sub-dates object and apply a method -%$ +%$ %$ d = B(2:3).sort ; %$ %$ if isa(d,'dates') @@ -330,4 +330,3 @@ end %$ end %$ T = all(t); %@eof:6 - diff --git a/src/@dates/uminus.m b/src/@dates/uminus.m index 3785e11d9ccbd32a79da1af6f1a84a7e31181a8f..4301ae46150b9659d43182722c3920e7da905c89 100644 --- a/src/@dates/uminus.m +++ b/src/@dates/uminus.m @@ -2,10 +2,10 @@ function B = uminus(A) % --*-- Unitary tests --*-- % Overloads the unary minus operator for dates objects. Shifts all the elements by one period. % -% INPUTS +% INPUTS % o A dates object with n elements. % -% OUTPUTS +% OUTPUTS % o B dates object with n elements. % Copyright (C) 2013 Dynare Team diff --git a/src/@dates/union.m b/src/@dates/union.m index c1437d45761d32340eac6f57b494dd5a9989845a..3372aa0bb851aabb929ef96676bdab595eaaf2db 100644 --- a/src/@dates/union.m +++ b/src/@dates/union.m @@ -2,13 +2,13 @@ function D = union(varargin) % --*-- Unitary tests --*-- % Overloads union function for dates objects (removes repetitions if any). % -% INPUTS +% INPUTS % o A dates object. % o B dates object. % o C dates object. % o ... % -% OUPUTS +% OUPUTS % o D dates object (elements are sorted by increasing order). % Copyright (C) 2013 Dynare Team diff --git a/src/@dates/unique.m b/src/@dates/unique.m index e655b511b6ceaeb73673b22d8ff1fec7e3d26a7a..355a4972d4effe16bea38f101bda2c54f448b806 100644 --- a/src/@dates/unique.m +++ b/src/@dates/unique.m @@ -2,10 +2,10 @@ function B = unique(A) % --*-- Unitary tests --*-- % Overloads the unique function for dates objects. % -% INPUTS +% INPUTS % o A dates object. % -% OUTPUTS +% OUTPUTS % o B dates object (a copy of A without repetitions, only the last occurence of a date is kept). % Copyright (C) 2012-2013 Dynare Team @@ -46,7 +46,7 @@ B.ndat = size(B.time,1); %$ B2 = '1950Q2'; %$ B3 = '1950q1'; %$ B4 = '1945Q3'; -%$ B5 = '1950Q2'; +%$ B5 = '1950Q2'; %$ %$ % Define expected results. %$ e.time = [1953 4; 1950 1; 1945 3; 1950 2]; @@ -56,7 +56,7 @@ B.ndat = size(B.time,1); %$ % Call the tested routine. %$ d = dates(B1,B2,B3,B4,B5); %$ d = d.unique(); -%$ +%$ %$ % Check the results. %$ t(1) = dassert(d.time,e.time); %$ t(2) = dassert(d.freq,e.freq); diff --git a/src/@dates/uplus.m b/src/@dates/uplus.m index 12aa0ff91ef562d2811bdfd0c3230ddbbfaeec60..a621633bb7eea1c559a538a88a0822e81603da25 100644 --- a/src/@dates/uplus.m +++ b/src/@dates/uplus.m @@ -2,10 +2,10 @@ function B = uplus(A) % --*-- Unitary tests --*-- % Overloads the unary plus operator for dates objects. Shifts all the elements by one period. % -% INPUTS +% INPUTS % o A dates object with n elements. % -% OUTPUTS +% OUTPUTS % o B dates object with n elements. % Copyright (C) 2013 Dynare Team diff --git a/src/@dates/vertcat.m b/src/@dates/vertcat.m index 6cf21743dd5dd027f0b5c7fbfa634b15b716f08b..3b222c0e8cc3bd82a0282cf331fd321eab78b358 100644 --- a/src/@dates/vertcat.m +++ b/src/@dates/vertcat.m @@ -1,22 +1,22 @@ function B = vertcat(varargin) - + % Overloads the vertcat method for dates objects. % -% INPUTS +% INPUTS % o A1 dates object. % o A2 dates object. % o ... % -% OUTPUTS +% OUTPUTS % o B dates object containing dates defined in A1, A2, ... % -% EXAMPLE 1 +% EXAMPLE 1 % If A, B and C are dates object the following syntax: -% +% % D = [A; B; C] ; % % Defines a dates object D containing the dates appearing in A, B and C. - + % Copyright (C) 2013 Dynare Team % % This file is part of Dynare. diff --git a/src/initialize_dates_toolbox.m b/src/initialize_dates_toolbox.m index c9928979caedc7920c27a001286decb66b999598..7185a0a65641df7151cff0db66f359c38852e557 100644 --- a/src/initialize_dates_toolbox.m +++ b/src/initialize_dates_toolbox.m @@ -14,7 +14,7 @@ if ~exist('isint','file') addpath([dates_src_root '/utilities/missing/isint']) end -if ~exist('isoctave','file') +if ~exist('isoctave','file') addpath([dates_src_root '/utilities/missing/isoctave']) end @@ -22,10 +22,10 @@ if ~isoctave && (~exist('rows','file') || ~exist('columns','file')) addpath([dates_src_root '/utilities/missing/dims']) end -if ~exist('shiftS','file') +if ~exist('shiftS','file') addpath([dates_src_root '/utilities/missing/shiftS']) end -if ~exist('matlab_ver_less_than','file') +if ~exist('matlab_ver_less_than','file') addpath([dates_src_root '/utilities/missing/matlab_ver_less_than']) end \ No newline at end of file diff --git a/src/utilities/convert/date2string.m b/src/utilities/convert/date2string.m index 26358ee23fc2060372421b542bb2bd846232df6a..8f180f21e54690d00422eb79adeaf633d4e107d8 100644 --- a/src/utilities/convert/date2string.m +++ b/src/utilities/convert/date2string.m @@ -1,15 +1,15 @@ function s = date2string(varargin) - + % Returns date as a string. % -% INPUTS +% INPUTS % o varargin{1} + dates object with one element, if nargin==1. % + 1*2 vector of integers (first element is the year, second element is the subperiod), if nargin==2. % o varargin{2} integer scalar equal to 1, 4, 12 or 52 (frequency). % -% OUTPUTS +% OUTPUTS % o s string. - + % Copyright (C) 2013 Dynare Team % % This file is part of Dynare. @@ -26,8 +26,8 @@ function s = date2string(varargin) % % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>. - -if isequal(nargin,1) + +if isequal(nargin,1) if ~(isa(varargin{1},'dates') && isequal(length(varargin{1}),1)) error(['dates::format: Input argument ' inputname(1) ' has to be a dates object with one element!']) else diff --git a/src/utilities/convert/freq2string.m b/src/utilities/convert/freq2string.m index 2d12f8def073acc9e2d260b25a32a5c82eb346a3..1f89de5e5fc6581cf9d9be137c9f1361cf99c639 100644 --- a/src/utilities/convert/freq2string.m +++ b/src/utilities/convert/freq2string.m @@ -1,11 +1,11 @@ function s = freq2string(freq) -% INPUTS +% INPUTS % o freq scalar integer, equal to 1, 4, 12 or 52 (resp. annual, quaterly, monthly or weekly) % -% OUTPUTS +% OUTPUTS % o s character, equal to Y, Q, M or W (resp. annual, quaterly, monthly or weekly) - + % Copyright (C) 2013 Dynare Team % % This file is part of Dynare. diff --git a/src/utilities/convert/string2date.m b/src/utilities/convert/string2date.m index fed6ff8f84916c78023416a0cc35f9c9b93bcb66..37466b6766f267f564c046ee645f4d547413553e 100644 --- a/src/utilities/convert/string2date.m +++ b/src/utilities/convert/string2date.m @@ -1,5 +1,5 @@ function date = string2date(a) % --*-- Unitary tests --*-- - + % Copyright (C) 2013 Dynare Team % % This file is part of Dynare. @@ -53,12 +53,12 @@ end function b = write_time_field(c, d) - b(1) = str2double(c(d)); - b(2) = str2double(c(d(end)+2:end)); +b(1) = str2double(c(d)); +b(2) = str2double(c(d(end)+2:end)); function b = write_time_field_y(c, d) - b(1) = str2double(c(d)); - b(2) = 1; +b(1) = str2double(c(d)); +b(2) = 1; %@test:1 %$ diff --git a/src/utilities/convert/string2freq.m b/src/utilities/convert/string2freq.m index ea04c39649e27a0f3555163d6e44ad612cc2009f..44793e7c117acc79d332c06bb4cd052e8c64bd7f 100644 --- a/src/utilities/convert/string2freq.m +++ b/src/utilities/convert/string2freq.m @@ -1,11 +1,11 @@ function freq = string2freq(s) -% INPUTS +% INPUTS % o s character, equal to Y, Q, M or W (resp. annual, quaterly, monthly or weekly) % -% OUTPUTS +% OUTPUTS % o freq scalar integer, equal to 1, 4, 12 or 52 (resp. annual, quaterly, monthly or weekly) - + % Copyright (C) 2013 Dynare Team % % This file is part of Dynare. diff --git a/src/utilities/is/isdate.m b/src/utilities/is/isdate.m index 2659ec39a794fb374dba50da42dbdacf6fcc8e0d..2cd973aac24bfdec26ee8083bcba4aa16b6bcc3d 100644 --- a/src/utilities/is/isdate.m +++ b/src/utilities/is/isdate.m @@ -2,10 +2,10 @@ function b = isdate(str) % --*-- Unitary tests --*-- % Tests if the input string can be interpreted as a date. % -% INPUTS +% INPUTS % o str string. % -% OUTPUTS +% OUTPUTS % o b integer scalar, equal to 1 if str can be interpreted as a date or 0 otherwise. % Copyright (C) 2013 Dynare Team diff --git a/src/utilities/is/isfreq.m b/src/utilities/is/isfreq.m index 79ba42c5395ab9484bff5e18f10a69ffb37b79d0..9f8e890a08f7dc221fa70fbf2d659ad62cc950e5 100644 --- a/src/utilities/is/isfreq.m +++ b/src/utilities/is/isfreq.m @@ -2,10 +2,10 @@ function B = isfreq(A) % Tests if A can be interpreted as a frequency. % -% INPUTS +% INPUTS % o A scalar integer or character. % -% OUTPUTS +% OUTPUTS % o B scalar integer equal to one if A can be interpreted as a frequency, zero otherwise. % Copyright (C) 2013 Dynare Team diff --git a/src/utilities/is/ismonthly.m b/src/utilities/is/ismonthly.m index b722b359fde07dddb097413c6f6cbc8d12879db0..8897a4e1df6c7a338865c2ddd986f9320e22a0ba 100644 --- a/src/utilities/is/ismonthly.m +++ b/src/utilities/is/ismonthly.m @@ -2,10 +2,10 @@ function b = ismonthly(str) % --*-- Unitary tests --*-- % Tests if the input can be interpreted as a monthly date. % -% INPUTS +% INPUTS % o str string. % -% OUTPUTS +% OUTPUTS % o b integer scalar, equal to 1 if str can be interpreted as a monthly date or 0 otherwise. % Copyright (C) 2012-2013 Dynare Team diff --git a/src/utilities/is/isquaterly.m b/src/utilities/is/isquaterly.m index d8d8146716cf67e9ba54b2d76d07a4bc15fdb459..5b9e614ffec0daab85236f0cc1753cfb72528f76 100644 --- a/src/utilities/is/isquaterly.m +++ b/src/utilities/is/isquaterly.m @@ -2,10 +2,10 @@ function b = isquaterly(str) % --*-- Unitary tests --*-- % Tests if the input can be interpreted as a quaterly date. % -% INPUTS +% INPUTS % o str string. % -% OUTPUTS +% OUTPUTS % o b integer scalar, equal to 1 if str can be interpreted as a quaterly date or 0 otherwise. % Copyright (C) 2012-2013 Dynare Team diff --git a/src/utilities/is/isstringdate.m b/src/utilities/is/isstringdate.m index d9c6d5e7cb41a409de1e30c4b448c7e8d000d82c..7e9f0b730c0e3fd1782d07d724431f4dddf156ba 100644 --- a/src/utilities/is/isstringdate.m +++ b/src/utilities/is/isstringdate.m @@ -2,10 +2,10 @@ function b = isstringdate(str) % --*-- Unitary tests --*-- % Tests if the input string can be interpreted as a date. % -% INPUTS +% INPUTS % o str string. % -% OUTPUTS +% OUTPUTS % o b integer scalar, equal to 1 if str can be interpreted as a date or 0 otherwise. % Copyright (C) 2013 Dynare Team diff --git a/src/utilities/is/isweekly.m b/src/utilities/is/isweekly.m index b7fbe934af3ea3befc8a2ab218f8074c5c93f8bf..15fb6709763834fe4de189e059704aaf1d15a1c2 100644 --- a/src/utilities/is/isweekly.m +++ b/src/utilities/is/isweekly.m @@ -2,10 +2,10 @@ function b = isweekly(str) % --*-- Unitary tests --*-- % Tests if the input can be interpreted as a weekly date. % -% INPUTS +% INPUTS % o str string. % -% OUTPUTS +% OUTPUTS % o b integer scalar, equal to 1 if str can be interpreted as a weekly date or 0 otherwise. % Copyright (C) 2012-2013 Dynare Team diff --git a/src/utilities/is/isyearly.m b/src/utilities/is/isyearly.m index bf8c03568a6666c9e62118c509bf1e55142659fd..ed30e5d35c111775cc88c28566bdba297773e34a 100644 --- a/src/utilities/is/isyearly.m +++ b/src/utilities/is/isyearly.m @@ -2,10 +2,10 @@ function b = isyearly(str) % --*-- Unitary tests --*-- % Tests if the input can be interpreted as a yearly date. % -% INPUTS +% INPUTS % o str string. % -% OUTPUTS +% OUTPUTS % o b integer scalar, equal to 1 if str can be interpreted as a yearly date or 0 otherwise. % Copyright (C) 2012-2013 Dynare Team diff --git a/src/utilities/missing/isint/isint.m b/src/utilities/missing/isint/isint.m index 8c170f3916934e93f8746fcb27e2431ab872a41d..61b9d498b90e3764ddce575d0687380feb9c95ab 100644 --- a/src/utilities/missing/isint/isint.m +++ b/src/utilities/missing/isint/isint.m @@ -2,15 +2,15 @@ function [l,c,d] = isint(a) % This function tests if the input argument is an integer. % -% INPUT +% INPUT % - a [double] m*n matrix. % -% OUTPUT -% - l [logical] m*n matrix of true and false (1 and 0). l(i,j)=true if a(i,j) is an integer. +% OUTPUT +% - l [logical] m*n matrix of true and false (1 and 0). l(i,j)=true if a(i,j) is an integer. % - c [integer] p*1 vector of indices pointing to the integer elements of a. % - d [integer] q*1 vector of indices pointing to the non integer elements of a. -% -% REMARKS +% +% REMARKS % p+q is equal to the product of m by n. % Copyright (C) 2009-2014 Dynare Team diff --git a/src/utilities/missing/isoctave/isoctave.m b/src/utilities/missing/isoctave/isoctave.m index 5d5273fbbf4541e5474c762670f55622acbf0583..4ea6d3f3293bf1da2ead78f2ec06a4b3d04c2e6c 100644 --- a/src/utilities/missing/isoctave/isoctave.m +++ b/src/utilities/missing/isoctave/isoctave.m @@ -1,7 +1,7 @@ function l = isoctave() % Tests if Octave is used. - + % Copyright (C) 2013-2014 Dynare Team % % This code is free software: you can redistribute it and/or modify diff --git a/src/utilities/missing/matlab_ver_less_than/matlab_ver_less_than.m b/src/utilities/missing/matlab_ver_less_than/matlab_ver_less_than.m index 020435b252c756ee6965a25f630d1ade18a709dc..f9c37011a93344668a78e71148bf26e994e806f1 100644 --- a/src/utilities/missing/matlab_ver_less_than/matlab_ver_less_than.m +++ b/src/utilities/missing/matlab_ver_less_than/matlab_ver_less_than.m @@ -2,13 +2,13 @@ function r = matlab_ver_less_than(verstr) % Returns 1 if current Matlab version is strictly older than the one given in argument. % -% INPUTS +% INPUTS % - verstr [string] Matlab's version as 'x.y' or 'x.y.z' -% -% OUTPUTS +% +% OUTPUTS % - r [logical] true or false (0 or 1) % -% REMARKS +% REMARKS % 1. This function will fail under Octave. % Copyright (C) 2008-2014 Dynare Team diff --git a/src/utilities/op/add_periods_to_array_of_dates.m b/src/utilities/op/add_periods_to_array_of_dates.m index cb3c4842d756547af0d8e74c6049ab243eb5eb5d..4712f2d1764901cf9b0bc41fa7e87974b023fa81 100644 --- a/src/utilities/op/add_periods_to_array_of_dates.m +++ b/src/utilities/op/add_periods_to_array_of_dates.m @@ -1,7 +1,7 @@ function time = add_periods_to_array_of_dates(time, freq, p) % --*-- Unitary tests --*-- % Adds a p periods (p can be negative) to a date (or a set of dates) characterized by array time and frequency freq. - + % Copyright (C) 2013 Dynare Team % % This file is part of Dynare. diff --git a/src/utilities/op/add_periods_to_date.m b/src/utilities/op/add_periods_to_date.m index 6a3da248edbc225c7507ae79ceb19c0dc6311094..038600df9afc9dc18ec4ba43d8329bf448111dde 100644 --- a/src/utilities/op/add_periods_to_date.m +++ b/src/utilities/op/add_periods_to_date.m @@ -1,7 +1,7 @@ function time = add_periods_to_date(time, freq, p) % --*-- Unitary tests --*-- % Adds a p periods (p can be negative) to a date (or a set of dates) characterized by array time and frequency freq. - + % Copyright (C) 2013 Dynare Team % % This file is part of Dynare.