Added instantiation from a Matlab table.

Need to add unit tests for this.
parent 2c2c8fef
......@@ -103,6 +103,13 @@ classdef dseries<handle % --*-- Unitary tests --*--
else
o.tex = tex;
end
elseif istable(varargin{1})
% It is assumed that the dates are in the first column.
thistable = varargin{1};
o.name = varargin{1}.Properties.VariableNames(2:end);
o.tex = name2tex(o.name);
o.data = varargin{1}{:,2:end};
o.dates = dates(varargin{1}{1,1}{1})+(0:size(varargin{1}, 1)-1);
elseif isnumeric(varargin{1}) && isequal(ndims(varargin{1}),2)
o.data = varargin{1};
o.name = default_name(vobs(o));
......
Markdown is supported
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