Commit ee9a7bde authored by Houtan Bastani's avatar Houtan Bastani
Browse files

stop with error when length operator is used. closes #35

parent f4bfaa88
function length(o)
% Overloads size function.
% Copyright (C) 2017 Dynare Team
% This file is part of Dynare.
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% GNU General Public License for more details.
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <>.
error(['dseries::length: we do not support the length operator on ' ...
'dseries. Please use ''nobs'' or ''vobs''']);
%$ % Define a dates object
%$ ts = dseries(randn(10,1));
%$ try
%$ p = length(ts)
%$ t(1) = false;
%$ catch
%$ t(1) = true;
%$ end
%$ T = all(t);
\ No newline at end of file
......@@ -85,6 +85,9 @@ switch S(1).type
case 'freq'
% Returns an integer characterizing the data frequency (1, 4, 12 or 52)
B = A.dates.freq;
case 'length'
error(['dseries::subsref: we do not support the length operator on ' ...
'dseries. Please use ''nobs'' or ''vobs''']);
case 'save'
% Save dseries object on disk (default is a mat file).
B = NaN;
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