Added overloaded disp and display methods for dynSeries objects.

time-shift
Stéphane Adjemian (Charybdis) 2013-06-24 12:26:58 +02:00
parent 51c4eb6cb3
commit 28f3ca1d07
2 changed files with 61 additions and 0 deletions

40
matlab/@dynSeries/disp.m Normal file
View File

@ -0,0 +1,40 @@
function disp(A)
%@info:
%! @deftypefn {Function File} disp (@var{A})
%! @anchor{@dynSeries/disp}
%! @sp 1
%! Overloads the disp method for the Dynare time series class (@ref{dynSeries}).
%! @sp 2
%! @strong{Inputs}
%! @sp 1
%! @table @ @var
%! @item A
%! Dynare time series object instantiated by @ref{dynSeries}.
%! @end table
%! @sp 1
%! @strong{Outputs}
%! @sp 1
%! None
%! @end deftypefn
%@eod:
separator = repmat(' | ',A.nobs+1,1);
vspace = ' ';
TABLE = ' ';
for t=1:A.nobs
TABLE = char(TABLE, format(A.time(t)));
end
for i = 1:A.vobs
TABLE = horzcat(TABLE,separator);
tmp = A.name{i};
for t=1:A.nobs
tmp = char(tmp,num2str(A.data(t,i)));
end
TABLE = horzcat(TABLE, tmp);
end
disp(vspace)
disp([inputname(1) ' is a dynSeries object:'])
disp(vspace);
disp(TABLE);
disp(vspace);

View File

@ -0,0 +1,21 @@
function display(A)
%@info:
%! @deftypefn {Function File} display (@var{A})
%! @anchor{@dynSeries/display}
%! @sp 1
%! Overloads the disp method for the Dynare time series class (@ref{dynSeries}).
%! @sp 2
%! @strong{Inputs}
%! @sp 1
%! @table @ @var
%! @item A
%! Dynare time series object instantiated by @ref{dynSeries}.
%! @end table
%! @sp 1
%! @strong{Outputs}
%! @sp 1
%! None
%! @end deftypefn
%@eod:
disp(A)