Skip to content

Commit

Permalink
sig.data.sum: new option enabling to keep the data structure after su…
Browse files Browse the repository at this point in the history
…mmation
  • Loading branch information
olivierlar committed Nov 12, 2019
1 parent 25f6028 commit 629998a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions +sig/@data/data.m
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@
end
end
%%
function obj = sum(obj,field,adjacent)
function obj = sum(obj,field,adjacent,keep)
if nargin<4
keep = false;
end
if nargin<3
adjacent = 1;
end
Expand Down Expand Up @@ -212,7 +215,7 @@
obj = res;
end
end
if adjacent < 2
if adjacent < 2 && ~keep
obj.dims(dim) = [];
order = 1:length(size(obj.content));
if length(order) >= dim
Expand Down

0 comments on commit 629998a

Please sign in to comment.