diff --git a/src/utilities/is/isfreq.m b/src/utilities/is/isfreq.m index 79ba42c5395ab9484bff5e18f10a69ffb37b79d0..f552bdca81e10f4e3686aae5fb433aea0a70699c 100644 --- a/src/utilities/is/isfreq.m +++ b/src/utilities/is/isfreq.m @@ -25,15 +25,15 @@ function B = isfreq(A) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>. -B = 0; +B = false; if ischar(A) if isequal(length(A),1) && ismember(upper(A),{'Y','A','Q','M','W'}) - B = 1; + B = true; return end end if isnumeric(A) && isequal(length(A),1) && ismember(A,[1 4 12 52]) - B = 1; + B = true; end \ No newline at end of file diff --git a/src/utilities/is/ismonthly.m b/src/utilities/is/ismonthly.m index b722b359fde07dddb097413c6f6cbc8d12879db0..bdf7e2460803db4f9df7fe53ebe6450455a57aa4 100644 --- a/src/utilities/is/ismonthly.m +++ b/src/utilities/is/ismonthly.m @@ -27,12 +27,12 @@ function b = ismonthly(str) % --*-- Unitary tests --*-- if ischar(str) if isempty(regexp(str,'^-?[0-9]*[Mm]([1-9]|1[0-2])$','once')) - b = 0; + b = false; else - b = 1; + b = true; end else - b = 0; + b = false; end %@test:1 @@ -46,13 +46,13 @@ end %$ date_7 = '1950Q3'; %$ date_8 = '1950m24'; %$ -%$ t(1) = dassert(ismonthly(date_1),1); -%$ t(2) = dassert(ismonthly(date_2),1); -%$ t(3) = dassert(ismonthly(date_3),1); -%$ t(4) = dassert(ismonthly(date_4),1); -%$ t(5) = dassert(ismonthly(date_5),0); -%$ t(6) = dassert(ismonthly(date_6),0); -%$ t(7) = dassert(ismonthly(date_7),0); -%$ t(8) = dassert(ismonthly(date_8),0); +%$ t(1) = dassert(ismonthly(date_1),true); +%$ t(2) = dassert(ismonthly(date_2),true); +%$ t(3) = dassert(ismonthly(date_3),true); +%$ t(4) = dassert(ismonthly(date_4),true); +%$ t(5) = dassert(ismonthly(date_5),false); +%$ t(6) = dassert(ismonthly(date_6),false); +%$ t(7) = dassert(ismonthly(date_7),false); +%$ t(8) = dassert(ismonthly(date_8),false); %$ T = all(t); %@eof:1 \ No newline at end of file diff --git a/src/utilities/is/isquaterly.m b/src/utilities/is/isquaterly.m index d8d8146716cf67e9ba54b2d76d07a4bc15fdb459..8171ca35c05ab08fdaac7021a3687ea52e849cca 100644 --- a/src/utilities/is/isquaterly.m +++ b/src/utilities/is/isquaterly.m @@ -27,12 +27,12 @@ function b = isquaterly(str) % --*-- Unitary tests --*-- if ischar(str) if isempty(regexp(str,'^-?[0-9]*[Qq][1-4]$','once')) - b = 0; + b = false; else - b = 1; + b = true; end else - b = 0; + b = false; end %@test:1 @@ -45,12 +45,12 @@ end %$ date_6 = '1950Y'; %$ date_7 = '1950m24'; %$ -%$ t(1) = dassert(isquaterly(date_1),1); -%$ t(2) = dassert(isquaterly(date_2),1); -%$ t(3) = dassert(isquaterly(date_3),1); -%$ t(4) = dassert(isquaterly(date_4),0); -%$ t(5) = dassert(isquaterly(date_5),0); -%$ t(6) = dassert(isquaterly(date_6),0); -%$ t(7) = dassert(isquaterly(date_7),0); +%$ 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 = 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 d9c6d5e7cb41a409de1e30c4b448c7e8d000d82c..56fe59cfd4e782d80aef83337e6fbfa031d33654 100644 --- a/src/utilities/is/isstringdate.m +++ b/src/utilities/is/isstringdate.m @@ -28,7 +28,7 @@ function b = isstringdate(str) % --*-- Unitary tests --*-- if ischar(str) b = isquaterly(str) || isyearly(str) || ismonthly(str) || isweekly(str); else - b = 0; + b = false; end %@test:1 diff --git a/src/utilities/is/isweekly.m b/src/utilities/is/isweekly.m index b7fbe934af3ea3befc8a2ab218f8074c5c93f8bf..4cdd20085730946ef5108a6d02c0fc91097e95a3 100644 --- a/src/utilities/is/isweekly.m +++ b/src/utilities/is/isweekly.m @@ -27,12 +27,12 @@ function b = isweekly(str) % --*-- Unitary tests --*-- if ischar(str) if isempty(regexp(str,'^-?[0-9]*[Ww]([1-9]|[1-4][0-9]|5[0-2])$','once')) - b = 0; + b = false; else - b = 1; + b = true; end else - b = 0; + b = false; end %@test:1 @@ -41,18 +41,18 @@ end %$ date_2 = '1950w2'; %$ date_3 = '-1950w2'; %$ date_4 = '1950w22'; -%$ date_5 = '1950 azd '; +%$ date_5 = '1950 azd'; %$ date_6 = '1950Y'; %$ date_7 = '1950Q3'; %$ date_8 = '1950m54'; %$ -%$ t(1) = dassert(isweekly(date_1),1); -%$ t(2) = dassert(isweekly(date_2),1); -%$ t(3) = dassert(isweekly(date_3),1); -%$ t(4) = dassert(isweekly(date_4),1); -%$ t(5) = dassert(isweekly(date_5),0); -%$ t(6) = dassert(isweekly(date_6),0); -%$ t(7) = dassert(isweekly(date_7),0); -%$ t(8) = dassert(isweekly(date_8),0); +%$ t(1) = dassert(isweekly(date_1),true); +%$ t(2) = dassert(isweekly(date_2),true); +%$ t(3) = dassert(isweekly(date_3),true); +%$ t(4) = dassert(isweekly(date_4),true); +%$ t(5) = dassert(isweekly(date_5),false); +%$ t(6) = dassert(isweekly(date_6),false); +%$ t(7) = dassert(isweekly(date_7),false); +%$ t(8) = dassert(isweekly(date_8),false); %$ T = all(t); %@eof:1 \ No newline at end of file diff --git a/src/utilities/is/isyearly.m b/src/utilities/is/isyearly.m index bf8c03568a6666c9e62118c509bf1e55142659fd..79508650a163bef751a5c938b22120eab87b135a 100644 --- a/src/utilities/is/isyearly.m +++ b/src/utilities/is/isyearly.m @@ -27,12 +27,12 @@ function b = isyearly(str) % --*-- Unitary tests --*-- if ischar(str) if isempty(regexp(str,'^-?[0-9]*[YyAa]$','once')) - b = 0; + b = false; else - b = 1; + b = true; end else - b = 0; + b = false; end %@test:1 @@ -46,13 +46,13 @@ end %$ date_7 = '-1950a'; %$ date_8 = '1950m24'; %$ -%$ t(1) = dassert(isyearly(date_1),0); -%$ t(2) = dassert(isyearly(date_2),0); -%$ t(3) = dassert(isyearly(date_3),0); -%$ t(4) = dassert(isyearly(date_4),0); -%$ t(5) = dassert(isyearly(date_5),0); -%$ t(6) = dassert(isyearly(date_6),1); -%$ t(7) = dassert(isyearly(date_7),1); -%$ t(8) = dassert(isyearly(date_8),0); +%$ t(1) = dassert(isyearly(date_1),false); +%$ t(2) = dassert(isyearly(date_2),false); +%$ t(3) = dassert(isyearly(date_3),false); +%$ t(4) = dassert(isyearly(date_4),false); +%$ t(5) = dassert(isyearly(date_5),false); +%$ t(6) = dassert(isyearly(date_6),true); +%$ t(7) = dassert(isyearly(date_7),true); +%$ t(8) = dassert(isyearly(date_8),false); %$ T = all(t); %@eof:1 \ No newline at end of file