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

fix bug with firstobservedperiod. closes #18

(cherry picked from commit 6b17c3de353d7202d4b47b7cc437063f4d542ad3)
parent 8decc584
Branches
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@ function d = firstobservedperiod(o) % --*-- Unitary tests --*--
% OUTPUTS
% - b [dates] First period where the N variables are observed (without NaNs).
% Copyright (C) 2016 Dynare Team
% Copyright (C) 2016-2017 Dynare Team
%
% This file is part of Dynare.
%
......@@ -27,6 +27,9 @@ function d = firstobservedperiod(o) % --*-- Unitary tests --*--
b = ~isnan(o);
c = find(prod(b, 2));
if isempty(c)
error('No overlapping non-NaN data points found in dseries.');
end
d = firstdate(o)+(c(1)-1);
%@test:1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment