From 558c818ccad4437f494c2f6f959a0b72b36884dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Fri, 13 Jun 2014 16:32:25 +0200 Subject: [PATCH] Changed logic in isfreq routine. --- matlab/utilities/dates/isfreq.m | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/matlab/utilities/dates/isfreq.m b/matlab/utilities/dates/isfreq.m index 38a779f20..79ba42c53 100644 --- a/matlab/utilities/dates/isfreq.m +++ b/matlab/utilities/dates/isfreq.m @@ -25,4 +25,15 @@ function B = isfreq(A) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see . -B = (ischar(A) && ismember(upper(A),{'Y','A','Q','M','W'})) || ismember(A,[1 4 12 52]); \ No newline at end of file +B = 0; + +if ischar(A) + if isequal(length(A),1) && ismember(upper(A),{'Y','A','Q','M','W'}) + B = 1; + return + end +end + +if isnumeric(A) && isequal(length(A),1) && ismember(A,[1 4 12 52]) + B = 1; +end \ No newline at end of file