diff --git a/matlab/reports/@table/table.m b/matlab/reports/@table/table.m index 0dd6ffa87..8be932055 100644 --- a/matlab/reports/@table/table.m +++ b/matlab/reports/@table/table.m @@ -75,9 +75,9 @@ assert(ischar(o.config), '@table.table: config file must be a string'); assert(islogical(o.hlines), '@table.table: hlines must be true or false'); assert(islogical(o.vlines), '@table.table: vlines must be true or false'); assert(isint(o.precision), '@table.table: precision must be an int'); -assert(isempty(o.range) || (iscell(o.range) && length(o.range) == 2 && ... - ischar(o.range{1}) && ischar(o.range{2})), ... - ['@table.table: range is specified as ''{''1999q1'',''1999q2''}''.']); +assert(isempty(o.range) || (isa(o.range, 'dynDates') && o.range.ndat >= 2), ... + ['@table.table: range is specified as a dynDates range, e.g. ' ... + '''dynDates(''1999q1''):dynDates(''1999q3'')''.']); assert(~isempty(o.data), '@table.table: must provide data'); msg = ['@table.table: data must either be a dynSeries or a cell array of ' ... diff --git a/matlab/reports/@table/write.m b/matlab/reports/@table/write.m index 63d691c65..d14238818 100644 --- a/matlab/reports/@table/write.m +++ b/matlab/reports/@table/write.m @@ -40,6 +40,10 @@ else ds = o.data{o.seriestouse{:}}; end +if ~isempty(o.range) + ds = ds(o.range); +end + %number of left-hand columns, 1 until we allow the user to group data, % e.g.: GDP Europe % GDP France