Skip to content
Snippets Groups Projects
Commit 2244ffc6 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Added instantiation from a Matlab table.

Need to add unit tests for this.
parent 2c2c8fef
Branches
No related tags found
No related merge requests found
......@@ -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));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment