diff --git a/src/@dseries/firstobservedperiod.m b/src/@dseries/firstobservedperiod.m index fa5d6a29476f12285604a51a0843cc64f4bd8e3c..92c1b239056f40aee80e660fc1b9e6a5e4545602 100644 --- a/src/@dseries/firstobservedperiod.m +++ b/src/@dseries/firstobservedperiod.m @@ -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