Commit 10740d8a authored by Houtan Bastani's avatar Houtan Bastani
Browse files

align: remove extraneous code

parent 0b49e51e
...@@ -11,7 +11,7 @@ function [o, p] = align_(o, p) % --*-- Unitary tests --*-- ...@@ -11,7 +11,7 @@ function [o, p] = align_(o, p) % --*-- Unitary tests --*--
% - o [dseries] % - o [dseries]
% - p [dseries] % - p [dseries]
% Copyright (C) 2013-2017 Dynare Team % Copyright (C) 2013-2018 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -32,28 +32,21 @@ if ~isequal(frequency(o),frequency(p)) ...@@ -32,28 +32,21 @@ if ~isequal(frequency(o),frequency(p))
error(['dseries::align: ''' inputname(1) ''' and ''' inputname(2) ''' dseries objects must have common frequencies!']) error(['dseries::align: ''' inputname(1) ''' and ''' inputname(2) ''' dseries objects must have common frequencies!'])
end end
init = min(firstdate(o),firstdate(p));
last = max(lastdate(o),lastdate(p));
if isempty(intersect(o.dates,p.dates)) if isempty(intersect(o.dates,p.dates))
error(['dseries::align: ''' inputname(1) ''' and ''' inputname(2) ''' dseries object must have at least one common date!']) error(['dseries::align: ''' inputname(1) ''' and ''' inputname(2) ''' dseries object must have at least one common date!'])
end end
o_init = init; init = min(firstdate(o),firstdate(p));
p_init = init; last = max(lastdate(o),lastdate(p));
o_last = last;
p_last = last;
if firstdate(p)>init if firstdate(p)>init
n = firstdate(p)-init; n = firstdate(p)-init;
p.data = [NaN(n, vobs(p)); p.data]; p.data = [NaN(n, vobs(p)); p.data];
p_init = init;
end end
if firstdate(o)>init if firstdate(o)>init
n = firstdate(o)-init; n = firstdate(o)-init;
o.data = [NaN(n, vobs(o)); o.data]; o.data = [NaN(n, vobs(o)); o.data];
o_init = init;
end end
if lastdate(p)<last if lastdate(p)<last
......
Supports Markdown
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