From 4e1c26db7633eb4d371d645581032009ae6dfcb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Scylla=29?= Date: Wed, 26 Mar 2014 11:39:52 +0100 Subject: [PATCH] Changed dseries' constructor so that the third and fourth inputs arguments accept cell of strings *and* character arrays. => It is possible to pass M_.endo_names as a third input argument. --- doc/dynare.texi | 4 ++-- matlab/@dseries/dseries.m | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/doc/dynare.texi b/doc/dynare.texi index 9d1d895f5..835284fad 100644 --- a/doc/dynare.texi +++ b/doc/dynare.texi @@ -9561,10 +9561,10 @@ A scalar integer, the number of observations. A scalar integer, the number of variables. @item name -A cell of strings, the names of the variables. +A @code{nobs}*1 cell of strings or a @code{nobs}*p character array, the names of the variables. @item tex - A cell of strings, the tex names of the variables. + A @code{nobs}*1 cell of strings or a @code{nobs}*p character array, the tex names of the variables. @item freq A scalar integer equal to 1, 4, 12 or 52, the frequency of the dataset. diff --git a/matlab/@dseries/dseries.m b/matlab/@dseries/dseries.m index 7fb9427ef..d1ab474f8 100644 --- a/matlab/@dseries/dseries.m +++ b/matlab/@dseries/dseries.m @@ -22,9 +22,9 @@ function ts = dseries(varargin) % --*-- Unitary tests --*-- %! @item b %! Initial date. For Quaterly, Monthly or Weekly data, b must be a string. For yearly data or if the frequence is not defined b must be an integer. %! @item c -%! N*1 cell array of strings. Names of the N time series. +%! N*1 cell array of strings or N*q array of strings. Names of the N time series. %! @item d -%! N*p array of characters. TeX names of the N time series. +%! N*1 cell array of strings or N*p array of characters. TeX names of the N time series. %! @end table %! @sp 2 %! @strong{Outputs} @@ -162,11 +162,17 @@ switch nargin d = {}; else d = varargin{4}; + if ~iscell(d) + d = cellstr(d); + end end if nargin<3 c = {}; else c = varargin{3}; + if ~iscell(c) + c = cellstr(c); + end end % Get data, number of observations and number of variables. ts.data = a;