1function length(o) % --*-- Unitary tests --*-- 2 3% Overloads size function. 4 5% Copyright (C) 2017 Dynare Team 6% 7% This file is part of Dynare. 8% 9% Dynare is free software: you can redistribute it and/or modify 10% it under the terms of the GNU General Public License as published by 11% the Free Software Foundation, either version 3 of the License, or 12% (at your option) any later version. 13% 14% Dynare is distributed in the hope that it will be useful, 15% but WITHOUT ANY WARRANTY; without even the implied warranty of 16% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17% GNU General Public License for more details. 18% 19% You should have received a copy of the GNU General Public License 20% along with Dynare. If not, see <http://www.gnu.org/licenses/>. 21 22error(['dseries::length: we do not support the length operator on ' ... 23 'dseries. Please use ''nobs'' or ''vobs''']); 24 25%@test:1 26%$ % Define a dates object 27%$ ts = dseries(randn(10,1)); 28%$ try 29%$ p = length(ts) 30%$ t(1) = false; 31%$ catch 32%$ t(1) = true; 33%$ end 34%$ 35%$ T = all(t); 36%@eof:1