Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dynare
reporting
Commits
98941c39
Commit
98941c39
authored
Feb 22, 2016
by
Houtan Bastani
Browse files
allow NaN's in table to be replaced by arbitrary text
parent
831783a3
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/@report_series/printSeries.m
View file @
98941c39
...
...
@@ -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
src/@report_series/report_series.m
View file @
98941c39
...
...
@@ -14,7 +14,7 @@ function o = report_series(varargin)
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2013-201
5
Dynare Team
% Copyright (C) 2013-201
6
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
;
...
...
src/@report_series/writeSeriesForTable.m
View file @
98941c39
...
...
@@ -17,7 +17,7 @@ function o = writeSeriesForTable(o, fid, dates, precision, ncols, rowcolor)
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2013-201
4
Dynare Team
% Copyright (C) 2013-201
6
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'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment