disp.m 1.3 KB
Newer Older
1
function disp(o)
2

3 4
% Overloads disp method.
%
Stéphane Adjemian's avatar
Stéphane Adjemian committed
5
% INPUTS
6 7
% - o  [dseries]   Object to be displayed.
%
Stéphane Adjemian's avatar
Stéphane Adjemian committed
8
% OUTPUTS
9
% None
10

11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
% Copyright (C) 2011-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
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% 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 <http://www.gnu.org/licenses/>.

28
vspace = ' ';
29

30 31 32 33 34 35 36
if ~vobs(o)
    disp(vspace)
    disp([inputname(1) ' is an empty dseries object.'])
    return
end

separator = repmat(' | ', nobs(o)+1,1);
37
TABLE = ' ';
38 39
for t=1:nobs(o)
    TABLE = char(TABLE, date2string(o.dates(t)));
40
end
41
for i = 1:vobs(o)
42
    TABLE = horzcat(TABLE,separator);
43 44 45
    tmp = o.name{i};
    for t=1:nobs(o)
        tmp = char(tmp,num2str(o.data(t,i)));
46 47 48 49 50 51 52 53
    end
    TABLE = horzcat(TABLE, tmp);
end
disp(vspace)
disp([inputname(1) ' is a dseries object:'])
disp(vspace);
disp(TABLE);
disp(vspace);