Skip to content
Snippets Groups Projects
Commit e01cabc9 authored by Houtan Bastani's avatar Houtan Bastani Committed by Stéphane Adjemian
Browse files

fix bug when concatenating series that don’t overlap. closes #17

(cherry picked from commit cd4bfdcf)

(cherry picked from commit 8c2ef8fb)
parent b322f12a
Branches
No related tags found
No related merge requests found
......@@ -97,8 +97,23 @@ function a = concatenate(b,c)
elseif b_last_date>c_last_date
c.data = [c.data; NaN(b_last_date-c_last_date, vobs(c))];
end
fillerdates = dates();
if max(c.dates) < min(b.dates)
fillerdates = max(c.dates):min(b.dates);
end
if max(b.dates) < min(c.dates)
fillerdates = max(b.dates):min(c.dates);
end
if isempty(fillerdates)
hd = [b.dates, c.dates];
else
hd = [b.dates, fillerdates, c.dates];
end
a.data = [b.data, c.data];
a.dates = sort(unique([b.dates, c.dates]));
a.dates = sort(unique(hd));
end
%@test:1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment