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.
time-shift
Stéphane Adjemian (Scylla) 2014-03-26 11:39:52 +01:00
parent 8956bddeba
commit 4e1c26db76
2 changed files with 10 additions and 4 deletions

View File

@ -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.

View File

@ -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;