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
afcbcece
Commit
afcbcece
authored
May 22, 2014
by
Houtan Bastani
Browse files
reporting: make zerotol work for both graphs and reports
parent
d94cc0d2
Changes
3
Hide whitespace changes
Inline
Side-by-side
@report_series/printSeries.m
View file @
afcbcece
...
...
@@ -36,7 +36,7 @@ dataString = sprintf('%%.%df', precision);
precision
=
10
^
precision
;
data
=
dser
(
dates
);
data
=
data
.
data
;
data
=
setDataToZeroFromZeroTol
(
o
,
data
)
;
for
i
=
1
:
size
(
data
,
1
)
fprintf
(
fid
,
'&'
);
if
o
.
tableShowMarkers
...
...
@report_series/setDataToZeroFromZeroTol.m
0 → 100644
View file @
afcbcece
function
d
=
setDataToZeroFromZeroTol
(
o
,
ds
)
%function d = setDataToZeroFromZeroTol(o, ds)
% Copyright (C) 2014 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/>.
d
=
ds
.
data
;
stz
=
bsxfun
(
@
and
,
...
bsxfun
(
@
lt
,
d
,
o
.
zeroTol
),
...
bsxfun
(
@
gt
,
d
,
-
o
.
zeroTol
));
if
any
(
stz
)
d
(
stz
)
=
0
;
end
end
\ No newline at end of file
@report_series/writeSeriesForGraph.m
View file @
afcbcece
...
...
@@ -105,16 +105,7 @@ else
ds
=
o
.
data
(
xrange
);
end
% if graphing data that is within zeroTol, set to zero, create report_series and
% get line:
thedata
=
ds
.
data
;
stz
=
bsxfun
(
@
and
,
...
bsxfun
(
@
lt
,
thedata
,
o
.
zeroTol
),
...
bsxfun
(
@
gt
,
thedata
,
-
o
.
zeroTol
));
if
any
(
stz
)
thedata
(
stz
)
=
0
;
end
thedata
=
setDataToZeroFromZeroTol
(
o
,
ds
);
fprintf
(
fid
,
'%%series %s\n\\addplot'
,
o
.
data
.
name
{:});
writeLineOptions
(
o
,
fid
);
fprintf
(
fid
,
'\ntable[row sep=crcr]{\nx y\\\\\n'
);
...
...
Write
Preview
Supports
Markdown
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