Commit 98941c39 authored by Houtan Bastani's avatar Houtan Bastani

allow NaN's in table to be replaced by arbitrary text

parent 831783a3
......@@ -15,7 +15,7 @@ function o = printSeries(o, fid, dser, dates, precision)
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2014 Dynare Team
% Copyright (C) 2014-2016 Dynare Team
%
% This file is part of Dynare.
%
......@@ -48,10 +48,15 @@ for i=1:size(data,1)
fprintf(fid, '[');
end
fprintf(fid, dataString, round(data(i)*precision)/precision);
output = round(data(i)*precision)/precision;
if isnan(output)
fprintf(fid, '%s', o.tableNaNSymb);
else
fprintf(fid, dataString, output);
end
if o.tableShowMarkers
fprintf(fid, ']');
end
end
end
\ No newline at end of file
end
......@@ -14,7 +14,7 @@ function o = report_series(varargin)
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2013-2015 Dynare Team
% Copyright (C) 2013-2016 Dynare Team
%
% This file is part of Dynare.
%
......@@ -73,6 +73,7 @@ o.tableRowColor = 'white';
o.tableRowIndent = 0;
o.tableDataRhs = '';
o.tableNaNSymb = 'NaN';
o.zeroTol = 1e-6;
......
......@@ -17,7 +17,7 @@ function o = writeSeriesForTable(o, fid, dates, precision, ncols, rowcolor)
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2013-2014 Dynare Team
% Copyright (C) 2013-2016 Dynare Team
%
% This file is part of Dynare.
%
......@@ -63,6 +63,7 @@ assert(isint(o.tableRowIndent) && o.tableRowIndent >= 0, ...
assert(islogical(o.tableShowMarkers), '@report_series.writeSeriesForTable: tableShowMarkers must be true or false');
assert(islogical(o.tableAlignRight), '@report_series.writeSeriesForTable: tableAlignRight must be true or false');
assert(isfloat(o.tableMarkerLimit), '@report_series.writeSeriesForTable: tableMarkerLimit must be a float');
assert(ischar(o.tableNaNSymb), '@report_series.writeSeriesForTable: tableNaNSymb must be a string');
%% Write Output
fprintf(fid, '%% Table Row (report_series)\n');
......
Markdown is supported
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