Commit 03b223fa authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Added missing output argument to load_data routine.

New ops class member.
parent 9e8e2b99
......@@ -72,12 +72,12 @@ methods
end
return
elseif ischar(varargin{1})
[init, data, varlist, tex] = load_data(varargin{1});
[init, data, varlist, tex, ops] = load_data(varargin{1});
o.data = data;
o.name = varlist;
o.dates = init:init+(nobs(o)-1);
o.tex = tex;
o.ops = cell(length(o.name), 1);
o.ops = ops;
elseif ~isoctave() && istable(varargin{1})
% It is assumed that the dates are in the first column.
thistable = varargin{1};
......@@ -98,24 +98,24 @@ methods
% Instantiate dseries object with a data file and force the initial date to
% be as given by the second input argument (initial period represented
% with a dates object).
[init, data, varlist, tex] = load_data(varargin{1});
[init, data, varlist, tex, ops] = load_data(varargin{1});
o.data = data;
o.name = varlist;
o.dates = varargin{2}:varargin{2}+(nobs(o)-1);
o.tex = tex;
o.ops = cell(length(o.name), 1);
o.ops = ops;
return
end
if isequal(nargin,2) && ischar(varargin{1}) && ischar(varargin{2}) && isdate(varargin{2})
% Instantiate dseries object with a data file and force the initial date to
% be as given by the second input argument (initial period represented with a
% string).
[init, data, varlist, tex] = load_data(varargin{1});
[init, data, varlist, tex, ops] = load_data(varargin{1});
o.data = data;
o.name = varlist;
o.dates = dates(varargin{2}):dates(varargin{2})+(nobs(o)-1);
o.tex = tex;
o.ops = cell(length(o.name), 1);
o.ops = ops;
return
end
a = varargin{1};
......
function [init, data, varlist, tex] = load_data(filename)
function [init, data, varlist, tex, ops] = load_data(filename)
% INPUTS
% - filename [string] Name of the file containing data.
......@@ -33,7 +33,7 @@ elseif check_file_extension(filename,'mat')
elseif check_file_extension(filename,'csv')
[freq, init, data, varlist] = load_csv_file_data(filename);
tex = [];
ops = [];
ops = cell(length(varlist), 1);
elseif check_file_extension(filename,'xls') || check_file_extension(filename,'xlsx')
if isglobalinbase('options_')
% Check that the object is instantiated within a dynare session so that options_ global structure exists.
......@@ -47,13 +47,11 @@ elseif check_file_extension(filename,'xls') || check_file_extension(filename,'xl
end
[freq, init, data, varlist] = load_xls_file_data(filename, sheet, range);
tex = [];
ops = [];
ops = cell(length(varlist), 1);
else
error('dseries:WrongInputArguments', 'I''m not able to load data from %s!', filename);
end
if isempty(tex)
tex = name2tex(varlist);
else
tex = tex;
end
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment