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