From 7154079a72d16733987e9e1bdc97b604692f080e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?=
 <stephane.adjemian@univ-lemans.fr>
Date: Sun, 8 Jun 2014 16:52:41 +0200
Subject: [PATCH] Fixed bug related to the initialization of the dseries and
 dates object (test that the input argument is a string).

---
 matlab/@dates/dates.m     | 2 +-
 matlab/@dseries/dseries.m | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/matlab/@dates/dates.m b/matlab/@dates/dates.m
index c442b4bb2b..99093bfe7a 100644
--- a/matlab/@dates/dates.m
+++ b/matlab/@dates/dates.m
@@ -62,7 +62,7 @@ function dd = dates(varargin) % --*-- 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/>.
 
-if nargin>0 && isequal(varargin{1},'initialize')
+if nargin>0 && ischar(varargin{1}) && isequal(varargin{1},'initialize')
     dd = struct('ndat', 0, 'freq', NaN(0), 'time', NaN(0,2));
     dd = class(dd,'dates');
     assignin('base','emptydatesobject',dd);
diff --git a/matlab/@dseries/dseries.m b/matlab/@dseries/dseries.m
index 213800c70a..b905ef31a7 100644
--- a/matlab/@dseries/dseries.m
+++ b/matlab/@dseries/dseries.m
@@ -76,7 +76,7 @@ function ts = dseries(varargin) % --*-- 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/>.
 
-if nargin>0 && isequal(varargin{1},'initialize')
+if nargin>0 && ischar(varargin{1}) && isequal(varargin{1},'initialize')
     ts = struct;
     ts.data  = [];
     ts.nobs  = 0;
-- 
GitLab