1function b = isnan(o) % --*-- Unitary tests --*--
2
3% Returns an array of logicals (true/false). Element (t,i) is true iff the i-th variable at
4% period number t is a NaN.
5%
6% INPUTS
7% - o [dseries]    with N variables and T periods.
8%
9% OUTPUTS
10% - b [logical]    T*N array of logicals.
11
12
13% Copyright (C) 2016-2017 Dynare Team
14%
15% This file is part of Dynare.
16%
17% Dynare is free software: you can redistribute it and/or modify
18% it under the terms of the GNU General Public License as published by
19% the Free Software Foundation, either version 3 of the License, or
20% (at your option) any later version.
21%
22% Dynare is distributed in the hope that it will be useful,
23% but WITHOUT ANY WARRANTY; without even the implied warranty of
24% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25% GNU General Public License for more details.
26%
27% You should have received a copy of the GNU General Public License
28% along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
29
30b = isnan(o.data);
31
32%@test:1
33%$ try
34%$     data = randn(100, 10);
35%$     cnan = randi(10, 50, 1);
36%$     rnan = randi(100, 50, 1);
37%$     for i=1:50, data(rnan(i),cnan(i)) = NaN; end
38%$     inan = isnan(data);
39%$     ts = dseries(data);
40%$     dd = ts.isnan();
41%$     t(1) = true;
42%$ catch
43%$     t(1) = false;
44%$ end
45%$
46%$ if t(1)
47%$     t(2) = isequal(dd, inan);
48%$ end
49%$
50%$ T = all(t);
51%@eof:1
52