From 18e68049342c39d025b26269a629a85508903c2e Mon Sep 17 00:00:00 2001 From: Houtan Bastani <houtan@dynare.org> Date: Fri, 17 Nov 2017 10:21:58 +0100 Subject: [PATCH] fix typo in isquarterly. closes #10 --- src/utilities/convert/string2date.m | 2 +- .../is/{isquaterly.m => isquarterly.m} | 20 +++++++++---------- src/utilities/is/isstringdate.m | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) rename src/utilities/is/{isquaterly.m => isquarterly.m} (70%) diff --git a/src/utilities/convert/string2date.m b/src/utilities/convert/string2date.m index 81172b9..96835ea 100644 --- a/src/utilities/convert/string2date.m +++ b/src/utilities/convert/string2date.m @@ -30,7 +30,7 @@ if isyearly(a) return end -if isquaterly(a) +if isquarterly(a) year = 1:(regexp(a,'[Qq]')-1); date.freq = 4; date.time = write_time_field(a, year); diff --git a/src/utilities/is/isquaterly.m b/src/utilities/is/isquarterly.m similarity index 70% rename from src/utilities/is/isquaterly.m rename to src/utilities/is/isquarterly.m index 2c421cb..1a0a8b3 100644 --- a/src/utilities/is/isquaterly.m +++ b/src/utilities/is/isquarterly.m @@ -1,12 +1,12 @@ -function b = isquaterly(str) % --*-- Unitary tests --*-- +function b = isquarterly(str) % --*-- Unitary tests --*-- -% Tests if the input can be interpreted as a quaterly date. +% Tests if the input can be interpreted as a quarterly date. % % INPUTS % o str string. % % OUTPUTS -% o b integer scalar, equal to 1 if str can be interpreted as a quaterly date or 0 otherwise. +% o b integer scalar, equal to 1 if str can be interpreted as a quarterly date or 0 otherwise. % Copyright (C) 2012-2017 Dynare Team % @@ -45,12 +45,12 @@ end %$ date_6 = '1950Y'; %$ date_7 = '1950m24'; %$ -%$ t(1) = dassert(isquaterly(date_1),true); -%$ t(2) = dassert(isquaterly(date_2),true); -%$ t(3) = dassert(isquaterly(date_3),true); -%$ t(4) = dassert(isquaterly(date_4),false); -%$ t(5) = dassert(isquaterly(date_5),false); -%$ t(6) = dassert(isquaterly(date_6),false); -%$ t(7) = dassert(isquaterly(date_7),false); +%$ t(1) = dassert(isquarterly(date_1),true); +%$ t(2) = dassert(isquarterly(date_2),true); +%$ t(3) = dassert(isquarterly(date_3),true); +%$ t(4) = dassert(isquarterly(date_4),false); +%$ t(5) = dassert(isquarterly(date_5),false); +%$ t(6) = dassert(isquarterly(date_6),false); +%$ t(7) = dassert(isquarterly(date_7),false); %$ T = all(t); %@eof:1 \ No newline at end of file diff --git a/src/utilities/is/isstringdate.m b/src/utilities/is/isstringdate.m index 3f1b84a..ffbcefc 100644 --- a/src/utilities/is/isstringdate.m +++ b/src/utilities/is/isstringdate.m @@ -26,7 +26,7 @@ function b = isstringdate(str) % --*-- Unitary tests --*-- % along with Dynare. If not, see <http://www.gnu.org/licenses/>. if ischar(str) - b = isquaterly(str) || isyearly(str) || ismonthly(str) || isweekly(str); + b = isquarterly(str) || isyearly(str) || ismonthly(str) || isweekly(str); else b = false; end -- GitLab