Commit 8c2ef8fb authored by Houtan Bastani's avatar Houtan Bastani Committed by Stéphane Adjemian (Charybdis)

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

(cherry picked from commit cd4bfdcf)
parent d850af4b
......@@ -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
......
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