Fixed indentation.

remove-priordens
Stéphane Adjemian (Charybdis) 2017-05-19 00:04:08 +02:00
parent 046a1b3804
commit 3d0abed99a
29 changed files with 436 additions and 436 deletions

View File

@ -30,78 +30,78 @@ function make_report_irfs(M, oo, ticks_every, showOutput)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
if ~isfield(oo, 'irfs')
disp('make_report_irfs: oo_.irfs does not exist');
return
end
fields = fieldnames(oo.irfs);
if isempty(fields)
disp('make_report_irfs: oo_.irfs is empty');
return
end
if ~isfield(M, 'exo_names')
disp('make_report_irfs: M_.exo_names does not exist');
return
end
if ~isfield(M, 'endo_names')
disp('make_report_irfs: M_.endo_names does not exist');
return
end
if ~isfield(M, 'fname')
disp('make_report_irfs: M_.fname does not exist');
return
end
if nargin < 3
ticks_every = 5;
else
assert(isint(ticks_every));
end
if nargin < 4
showOutput = true;
else
assert(islogical(showOutput));
end
n6 = 1;
justAddedPage = 0;
calcxticks = false;
r = report('filename', [M.fname '_canned_irf_report.tex'], 'showOutput', showOutput);
for i = 1:length(M.exo_names)
newexo = 1;
for j = 1:length(M.endo_names)
idx = ismember(fields,[strtrim(M.endo_names(j,:)) '_' ...
strtrim(M.exo_names(i,:))]);
if (mod(n6 - 1, 6) == 0 && ~justAddedPage) || ...
(newexo && any(idx))
r = r.addPage('title', {'Canned Irf Report'; ['shock ' ...
strrep(strtrim(M.exo_names(i,:)),'_','\_')]});
r = r.addSection('cols', 2);
n6 = 1;
justAddedPage = 1;
newexo = 0;
end
if any(idx)
if ~calcxticks
data = dseries(oo.irfs.(fields{idx})');
xTicks = 1:ticks_every:floor(data.nobs/ticks_every)*ticks_every+1;
xTickLabels = regexp(num2str(xTicks-1), '(?:\s)+', 'split');
calcxticks = true;
end
r = r.addGraph('data', dseries(oo.irfs.(fields{idx})'), ...
'title', strrep(M.endo_names(j,:), '_', '\_'), ...
'titleFormat', '\Huge', ...
'showGrid', false, ...
'yTickLabelZeroFill', false, ...
'yTickLabelPrecision', 1, ...
'showZeroLine', true, ...
'zeroLineColor', 'red', ...
'xTicks', xTicks, ...
'xTickLabels', xTickLabels);
n6 = n6 + 1;
justAddedPage = 0;
end
end
end
r.write();
r.compile();
if ~isfield(oo, 'irfs')
disp('make_report_irfs: oo_.irfs does not exist');
return
end
fields = fieldnames(oo.irfs);
if isempty(fields)
disp('make_report_irfs: oo_.irfs is empty');
return
end
if ~isfield(M, 'exo_names')
disp('make_report_irfs: M_.exo_names does not exist');
return
end
if ~isfield(M, 'endo_names')
disp('make_report_irfs: M_.endo_names does not exist');
return
end
if ~isfield(M, 'fname')
disp('make_report_irfs: M_.fname does not exist');
return
end
if nargin < 3
ticks_every = 5;
else
assert(isint(ticks_every));
end
if nargin < 4
showOutput = true;
else
assert(islogical(showOutput));
end
n6 = 1;
justAddedPage = 0;
calcxticks = false;
r = report('filename', [M.fname '_canned_irf_report.tex'], 'showOutput', showOutput);
for i = 1:length(M.exo_names)
newexo = 1;
for j = 1:length(M.endo_names)
idx = ismember(fields,[strtrim(M.endo_names(j,:)) '_' ...
strtrim(M.exo_names(i,:))]);
if (mod(n6 - 1, 6) == 0 && ~justAddedPage) || ...
(newexo && any(idx))
r = r.addPage('title', {'Canned Irf Report'; ['shock ' ...
strrep(strtrim(M.exo_names(i,:)),'_','\_')]});
r = r.addSection('cols', 2);
n6 = 1;
justAddedPage = 1;
newexo = 0;
end
if any(idx)
if ~calcxticks
data = dseries(oo.irfs.(fields{idx})');
xTicks = 1:ticks_every:floor(data.nobs/ticks_every)*ticks_every+1;
xTickLabels = regexp(num2str(xTicks-1), '(?:\s)+', 'split');
calcxticks = true;
end
r = r.addGraph('data', dseries(oo.irfs.(fields{idx})'), ...
'title', strrep(M.endo_names(j,:), '_', '\_'), ...
'titleFormat', '\Huge', ...
'showGrid', false, ...
'yTickLabelZeroFill', false, ...
'yTickLabelPrecision', 1, ...
'showZeroLine', true, ...
'zeroLineColor', 'red', ...
'xTicks', xTicks, ...
'xTickLabels', xTickLabels);
n6 = n6 + 1;
justAddedPage = 0;
end
end
end
r.write();
r.compile();
end

View File

@ -188,7 +188,7 @@ assert(iscellstr(o.xTickLabels) || (ischar(o.xTickLabels) && strcmpi(o.xTickLabe
'equivalent to the string ''ALL''']);
if ~isempty(o.xTickLabels)
assert((ischar(o.xTickLabels) && strcmpi(o.xTickLabels, 'ALL')) || ...
~isempty(o.xTicks), ['@graph.graph: if you set xTickLabels and ' ...
~isempty(o.xTicks), ['@graph.graph: if you set xTickLabels and ' ...
'it''s not equal to ''ALL'', you must set xTicks']);
end
if ~isempty(o.xTicks)

View File

@ -29,21 +29,21 @@ if length(S) > 1
end
switch S.type
case '()'
index = S.subs{:};
assert(isnumeric(index));
B.series{index} = V;
case '.'
switch S.subs
case fieldnames(A)
B.(S.subs) = V;
otherwise
error(['@graph.subsasgn: field ' S.subs 'does not exist']);
end
case '{}'
assert(isint(S.subs{1}));
B{S.subs{1}} = V;
otherwise
error('@graph.subsasgn: syntax error');
case '()'
index = S.subs{:};
assert(isnumeric(index));
B.series{index} = V;
case '.'
switch S.subs
case fieldnames(A)
B.(S.subs) = V;
otherwise
error(['@graph.subsasgn: field ' S.subs 'does not exist']);
end
case '{}'
assert(isint(S.subs{1}));
B{S.subs{1}} = V;
otherwise
error('@graph.subsasgn: syntax error');
end
end

View File

@ -19,31 +19,31 @@ function A = subsref(A, S)
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
switch S(1).type
case '.'
switch S(1).subs
case fieldnames(A)
A = A.(S(1).subs);
case methods(A)
if areParensNext(S)
A = feval(S(1).subs, A, S(2).subs{:});
S = shiftS(S,1);
else
A = feval(S(1).subs, A);
end
otherwise
error(['@graph.subsref: unknown field or method: ' S(1).subs]);
end
case '()'
if isempty(S(1).subs{:})
A = A.series;
else
assert(isnumeric(S(1).subs{:}));
A = A.series{S(1).subs{:}};
end
case '{}'
case '.'
switch S(1).subs
case fieldnames(A)
A = A.(S(1).subs);
case methods(A)
if areParensNext(S)
A = feval(S(1).subs, A, S(2).subs{:});
S = shiftS(S,1);
else
A = feval(S(1).subs, A);
end
otherwise
error(['@graph.subsref: unknown field or method: ' S(1).subs]);
end
case '()'
if isempty(S(1).subs{:})
A = A.series;
else
assert(isnumeric(S(1).subs{:}));
A = A.series{S(1).subs{:}};
otherwise
error('@graph.subsref: impossible case')
end
case '{}'
A = A.series{S(1).subs{:}};
otherwise
error('@graph.subsref: impossible case')
end
S = shiftS(S,1);

View File

@ -246,7 +246,7 @@ end
if o.showZeroline
fprintf(fid, '%%zeroline\n\\addplot[%s,line width=.5,forget plot] coordinates {(1,0)(%d,0)};\n', ...
o.zeroLineColor, dd.ndat);
o.zeroLineColor, dd.ndat);
end
if o.writeCSV
@ -254,61 +254,61 @@ if o.writeCSV
end
if isunix && ~ismac
for i=1:ne
isfan = ~isempty(o.series{i}.graphFanShadeColor);
if isfan
break
for i=1:ne
isfan = ~isempty(o.series{i}.graphFanShadeColor);
if isfan
break
end
end
end
if isfan
data = dseries();
for i=1:ne
tmp = o.series{i}.data;
tmp = tmp.set_names(int2str(i));
data = [data tmp];
end
if isfan
data = dseries();
for i=1:ne
tmp = o.series{i}.data;
tmp = tmp.set_names(int2str(i));
data = [data tmp];
end
if isempty(dd) || all(dd == data.dates)
ds = data;
else
ds = data(dd);
end
if isempty(dd) || all(dd == data.dates)
ds = data;
else
ds = data(dd);
end
for i=2:ne
tmp = ds{i} - ds{i-1};
idx = find(tmp.data ~= 0);
split = ds(ds.dates(idx));
end
idx = find(ds.dates == split.dates(1));
for i=2:ne
fprintf(fid, '\\addplot[fill=%s!%d, draw=none, forget plot] coordinates {',...
o.series{i}.graphFanShadeColor, o.series{i}.graphFanShadeOpacity);
for j=idx-1:ds.dates.ndat
fprintf(fid, '(%d, %f) ', j, ds{i-1}(ds.dates(j),1).data);
end
for j=ds.dates.ndat:-1:idx-1
fprintf(fid, '(%d, %f) ', j, ds{i}(ds.dates(j),1).data);
end
fprintf(fid, '} \\closedcycle;\n');
end
end
for i=2:ne
tmp = ds{i} - ds{i-1};
idx = find(tmp.data ~= 0);
split = ds(ds.dates(idx));
end
idx = find(ds.dates == split.dates(1));
for i=2:ne
fprintf(fid, '\\addplot[fill=%s!%d, draw=none, forget plot] coordinates {',...
o.series{i}.graphFanShadeColor, o.series{i}.graphFanShadeOpacity);
for j=idx-1:ds.dates.ndat
fprintf(fid, '(%d, %f) ', j, ds{i-1}(ds.dates(j),1).data);
end
for j=ds.dates.ndat:-1:idx-1
fprintf(fid, '(%d, %f) ', j, ds{i}(ds.dates(j),1).data);
end
fprintf(fid, '} \\closedcycle;\n');
end
end
end
for i=1:ne
o.series{i}.writeSeriesForGraph(fid, dd, i);
if o.writeCSV
csvseries = [csvseries ...
o.series{i}.data(dd).set_names([...
o.series{i}.data.name{:} '_' ...
o.series{i}.graphLegendName '_' ...
o.series{i}.graphLineColor '_' ...
o.series{i}.graphLineStyle '_' ...
num2str(o.series{i}.graphLineWidth) '_' ...
o.series{i}.graphMarker '_' ...
o.series{i}.graphMarkerEdgeColor '_' ...
o.series{i}.graphMarkerFaceColor '_' ...
num2str(o.series{i}.graphMarkerSize)]) ...
];
o.series{i}.data(dd).set_names([...
o.series{i}.data.name{:} '_' ...
o.series{i}.graphLegendName '_' ...
o.series{i}.graphLineColor '_' ...
o.series{i}.graphLineStyle '_' ...
num2str(o.series{i}.graphLineWidth) '_' ...
o.series{i}.graphMarker '_' ...
o.series{i}.graphMarkerEdgeColor '_' ...
o.series{i}.graphMarkerFaceColor '_' ...
num2str(o.series{i}.graphMarkerSize)]) ...
];
end
if o.showLegend
le = o.series{i}.getNameForLegend();

View File

@ -82,8 +82,8 @@ assert(iscellstr(o.title), ...
assert(iscellstr(o.titleFormat), ...
'@page.page: titleFormat must be a cell array of strings');
assert((ischar(o.titleTruncate) && isempty(o.titleTruncate)) || ...
isint(o.titleTruncate), ...
'@page.page: titleTruncate must be empty or an integer.');
isint(o.titleTruncate), ...
'@page.page: titleTruncate must be empty or an integer.');
assert(ischar(o.pageDirName), '@page.page: pageDirName must be a string');
assert(ischar(o.latex), ...
'@page.page: latex must be a string');

View File

@ -29,18 +29,18 @@ if length(S) > 1
end
switch S.type
case '()'
index = S.subs{:};
assert(isnumeric(index));
B{index} = V;
case '.'
switch S.subs
case fieldnames(A)
B.(S.subs) = V;
otherwise
error(['@page.subsasgn: field ' S.subs 'does not exist']);
end
otherwise
error('@page.subsasgn: syntax error');
case '()'
index = S.subs{:};
assert(isnumeric(index));
B{index} = V;
case '.'
switch S.subs
case fieldnames(A)
B.(S.subs) = V;
otherwise
error(['@page.subsasgn: field ' S.subs 'does not exist']);
end
otherwise
error('@page.subsasgn: syntax error');
end
end

View File

@ -19,26 +19,26 @@ function A = subsref(A, S)
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
switch S(1).type
case '.'
switch S(1).subs
case fieldnames(A)
A = A.(S(1).subs);
case methods(A)
if areParensNext(S)
A = feval(S(1).subs, A, S(2).subs{:});
S = shiftS(S,1);
else
A = feval(S(1).subs, A);
end
otherwise
error(['@page.subsref: unknown field or method: ' S(1).subs]);
end
case '()'
A = getSections(A, S(1).subs{:});
case '{}'
error(['@page.subsref: ' S(1).type ' indexing not supported.']);
otherwise
error('@page.subsref: impossible case')
case '.'
switch S(1).subs
case fieldnames(A)
A = A.(S(1).subs);
case methods(A)
if areParensNext(S)
A = feval(S(1).subs, A, S(2).subs{:});
S = shiftS(S,1);
else
A = feval(S(1).subs, A);
end
otherwise
error(['@page.subsref: unknown field or method: ' S(1).subs]);
end
case '()'
A = getSections(A, S(1).subs{:});
case '{}'
error(['@page.subsref: ' S(1).type ' indexing not supported.']);
otherwise
error('@page.subsref: impossible case')
end
S = shiftS(S,1);

View File

@ -66,7 +66,7 @@ else
end
fprintf(fid,'\\multicolumn{1}{c}{%s %s}\\\\\n', o.titleFormat{i}, o.title{i});
end
nps = length(o.sections);
for i=1:nps
o.sections{i}.write(fid, pg, i);

View File

@ -29,22 +29,22 @@ if length(S) > 1
end
switch S.type
case '()'
index = S.subs{:};
assert(isnumeric(index));
B.elements{index} = V;
case '{}'
index = S.subs{:};
assert(isnumeric(index));
B{index} = V;
case '.'
switch S.subs
case fieldnames(A)
B.(S.subs) = V;
otherwise
error(['@paragraph.subsasgn: field ' S.subs 'does not exist']);
end
otherwise
error('@paragraph.subsasgn: syntax error');
case '()'
index = S.subs{:};
assert(isnumeric(index));
B.elements{index} = V;
case '{}'
index = S.subs{:};
assert(isnumeric(index));
B{index} = V;
case '.'
switch S.subs
case fieldnames(A)
B.(S.subs) = V;
otherwise
error(['@paragraph.subsasgn: field ' S.subs 'does not exist']);
end
otherwise
error('@paragraph.subsasgn: syntax error');
end
end

View File

@ -19,26 +19,26 @@ function A = subsref(A, S)
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
switch S(1).type
case '.'
switch S(1).subs
case fieldnames(A)
A = A.(S(1).subs);
case methods(A)
if areParensNext(S)
A = feval(S(1).subs, A, S(2).subs{:});
S = shiftS(S,1);
else
A = feval(S(1).subs, A);
end
otherwise
error(['@paragraph.subsref: unknown field or method: ' S(1).subs]);
end
case '()'
A = A.elements{S(1).subs{:}};
case '{}'
error(['@paragraph.subsref: ' S(1).type ' indexing not supported.']);
otherwise
error('@paragraph.subsref: impossible case')
case '.'
switch S(1).subs
case fieldnames(A)
A = A.(S(1).subs);
case methods(A)
if areParensNext(S)
A = feval(S(1).subs, A, S(2).subs{:});
S = shiftS(S,1);
else
A = feval(S(1).subs, A);
end
otherwise
error(['@paragraph.subsref: unknown field or method: ' S(1).subs]);
end
case '()'
A = A.elements{S(1).subs{:}};
case '{}'
error(['@paragraph.subsref: ' S(1).type ' indexing not supported.']);
otherwise
error('@paragraph.subsref: impossible case')
end
S = shiftS(S,1);

View File

@ -67,7 +67,7 @@ if isempty(opts.compiler)
if ismac
% Add most likely places for pdflatex to exist outside of default $PATH
[status, opts.compiler] = ...
system('PATH=$PATH:/usr/texbin:/usr/local/bin:/usr/local/sbin;which pdflatex');
system('PATH=$PATH:/usr/texbin:/usr/local/bin:/usr/local/sbin;which pdflatex');
elseif ispc
[status, opts.compiler] = system('findtexmf --file-type=exe pdflatex');
if status == 1
@ -105,7 +105,7 @@ end
if status ~= 0
error(['@report.compile: There was an error in compiling ' rfn '.pdf.' ...
' ' opts.compiler ' returned the error code: ' num2str(status)]);
' ' opts.compiler ' returned the error code: ' num2str(status)]);
end
if o.showOutput || opts.showOutput
disp('Done.');

View File

@ -29,18 +29,18 @@ if length(S) > 1
end
switch S.type
case '()'
index = S.subs{:};
assert(isnumeric(index));
B.pages{index} = V;
case '.'
switch S.subs
case fieldnames(A)
B.(S.subs) = V;
otherwise
error(['@report.subsasgn: field ' S.subs 'does not exist']);
end
otherwise
error('@report.subsasgn: syntax error');
case '()'
index = S.subs{:};
assert(isnumeric(index));
B.pages{index} = V;
case '.'
switch S.subs
case fieldnames(A)
B.(S.subs) = V;
otherwise
error(['@report.subsasgn: field ' S.subs 'does not exist']);
end
otherwise
error('@report.subsasgn: syntax error');
end
end

View File

@ -19,26 +19,26 @@ function A = subsref(A, S)
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
switch S(1).type
case '.'
switch S(1).subs
case fieldnames(A)
A = A.(S(1).subs);
case methods(A)
if areParensNext(S)
A = feval(S(1).subs, A, S(2).subs{:});
S = shiftS(S,1);
else
A = feval(S(1).subs, A);
end
otherwise
error(['@report.subsasgn: unknown field or method: ' S(1).subs]);
end
case '()'
A = A.pages{S(1).subs{:}};
case '{}'
error(['@report.subsasgn: ' S(1).type ' indexing not supported.']);
otherwise
error('@report.subsasgn: impossible case');
case '.'
switch S(1).subs
case fieldnames(A)
A = A.(S(1).subs);
case methods(A)
if areParensNext(S)
A = feval(S(1).subs, A, S(2).subs{:});
S = shiftS(S,1);
else
A = feval(S(1).subs, A);
end
otherwise
error(['@report.subsasgn: unknown field or method: ' S(1).subs]);
end
case '()'
A = A.pages{S(1).subs{:}};
case '{}'
error(['@report.subsasgn: ' S(1).type ' indexing not supported.']);
otherwise
error('@report.subsasgn: impossible case');
end
S = shiftS(S,1);

View File

@ -29,14 +29,14 @@ if length(S) > 1
end
switch S.type
case '.'
switch S.subs
case fieldnames(A)
B.(S.subs) = V;
otherwise
error(['@report_series.subsasgn: field ' S.subs 'does not exist']);
end
otherwise
error('@report_series.subsasgn: syntax error');
case '.'
switch S.subs
case fieldnames(A)
B.(S.subs) = V;
otherwise
error(['@report_series.subsasgn: field ' S.subs 'does not exist']);
end
otherwise
error('@report_series.subsasgn: syntax error');
end
end

View File

@ -19,24 +19,24 @@ function A = subsref(A, S)
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
switch S(1).type
case '.'
switch S(1).subs
case fieldnames(A)
A = A.(S(1).subs);
case methods(A)
if areParensNext(S)
A = feval(S(1).subs, A, S(2).subs{:});
S = shiftS(S,1);
else
A = feval(S(1).subs, A);
end
otherwise
error(['@report_series.subsref: unknown field or method: ' S(1).subs]);
end
case {'()', '{}'}
error(['@report_series.subsref: ' S(1).type ' indexing not supported.']);
otherwise
error('@report_series.subsref: impossible case')
case '.'
switch S(1).subs
case fieldnames(A)
A = A.(S(1).subs);
case methods(A)
if areParensNext(S)
A = feval(S(1).subs, A, S(2).subs{:});
S = shiftS(S,1);
else
A = feval(S(1).subs, A);
end
otherwise
error(['@report_series.subsref: unknown field or method: ' S(1).subs]);
end
case {'()', '{}'}
error(['@report_series.subsref: ' S(1).type ' indexing not supported.']);
otherwise
error('@report_series.subsref: impossible case')
end
S = shiftS(S,1);

View File

@ -45,14 +45,14 @@ assert(islogical(o.graphShowInLegend), ['@report_series.writeSeriesForGraph: ' .
assert(ischar(o.graphLineColor), '@report_series.writeSeriesForGraph: graphLineColor must be a string');
assert(ischar(o.graphLineStyle), '@report_series.writeSeriesForGraph: graphLineStyle must be a string');
assert(isfloat(o.graphLineWidth) && o.graphLineWidth > 0, ...
'@report_series.writeSeriesForGraph: graphLineWidth must be a positive number');
'@report_series.writeSeriesForGraph: graphLineWidth must be a positive number');
% Bar
assert(islogical(o.graphBar), '@report_series.writeSeriesForGraph: graphBar must be either true or false');
assert(ischar(o.graphBarColor), '@report_series.writeSeriesForGraph: graphBarColor must be a string');
assert(ischar(o.graphBarFillColor), '@report_series.writeSeriesForGraph: graphBarFillColor must be a string');
assert(isfloat(o.graphBarWidth) && o.graphBarWidth > 0, ...
'@report_series.writeSeriesForGraph: graphbarWidth must be a positive number');
'@report_series.writeSeriesForGraph: graphbarWidth must be a positive number');
% GraphMarker
valid_graphMarker = {'x', '+', '-', '|', 'o', 'asterisk', 'star', '10-pointed star', 'oplus', ...
@ -66,7 +66,7 @@ assert(isempty(o.graphMarker) || any(strcmp(o.graphMarker, valid_graphMarker)),
assert(ischar(o.graphMarkerEdgeColor), '@report_series.writeSeriesForGraph: graphMarkerEdgeColor must be a string');
assert(ischar(o.graphMarkerFaceColor), '@report_series.writeSeriesForGraph: graphMarkerFaceColor must be a string');
assert(isfloat(o.graphMarkerSize) && o.graphMarkerSize > 0, ...
'@report_series.writeSeriesForGraph: graphMarkerSize must be a positive number');
'@report_series.writeSeriesForGraph: graphMarkerSize must be a positive number');
% Marker & Line
assert(~(strcmp(o.graphLineStyle, 'none') && isempty(o.graphMarker)), ['@report_series.writeSeriesForGraph: ' ...
@ -74,9 +74,9 @@ assert(~(strcmp(o.graphLineStyle, 'none') && isempty(o.graphMarker)), ['@report_
% Validate graphVline
assert(isempty(o.graphVline) || (isdates(o.graphVline) && o.graphVline.ndat == 1), ...
'@report_series.writeSeriesForGraph: graphVline must be a dates of size one');
'@report_series.writeSeriesForGraph: graphVline must be a dates of size one');
assert(isempty(o.graphHline) || isnumeric(o.graphHline), ...
'@report_series.writeSeriesForGraph: graphHline must a single numeric value');
'@report_series.writeSeriesForGraph: graphHline must a single numeric value');
% Zero tolerance
assert(isfloat(o.zeroTol), '@report_series.write: zeroTol must be a float');
@ -92,8 +92,8 @@ if ~isempty(o.graphVline)
stringsdd = strings(xrange);
x = find(strcmpi(date2string(o.graphVline), stringsdd));
fprintf(fid, ['(axis cs:%d,\\pgfkeysvalueof{/pgfplots/ymin}) -- (axis ' ...
'cs:%d,\\pgfkeysvalueof{/pgfplots/ymax});\n\\end{pgfonlayer}\n'], ...
x, x);
'cs:%d,\\pgfkeysvalueof{/pgfplots/ymax});\n\\end{pgfonlayer}\n'], ...
x, x);
end
if ~isempty(o.graphHline)
fprintf(fid, '%%Horizontal Line\n\\begin{pgfonlayer}{axis lines}\n\\addplot');
@ -127,13 +127,13 @@ fprintf(fid,'};\n');
% For Fan charts
if ispc || ismac
if ~isempty(o.graphFanShadeColor)
assert(isint(series_num) && series_num > 1, ['@report_series.writeSeriesForGraph: can only add '...
'graphFanShadeColor and graphFanShadeOpacity starting from the ' ...
'second series in the graph']);
fprintf(fid, '\\addplot[%s!%d, forget plot] fill between[of=%d and %d];\n', ...
o.graphFanShadeColor, o.graphFanShadeOpacity, series_num, series_num - 1);
end
if ~isempty(o.graphFanShadeColor)
assert(isint(series_num) && series_num > 1, ['@report_series.writeSeriesForGraph: can only add '...
'graphFanShadeColor and graphFanShadeOpacity starting from the ' ...
'second series in the graph']);
fprintf(fid, '\\addplot[%s!%d, forget plot] fill between[of=%d and %d];\n', ...
o.graphFanShadeColor, o.graphFanShadeOpacity, series_num, series_num - 1);
end
end
end
@ -160,8 +160,8 @@ if ~isempty(o.graphMiscTikzAddPlotOptions)
fprintf(fid, ',%s', o.graphMiscTikzAddPlotOptions);
end
if isunix && ~ismac
fprintf(fid,']');
fprintf(fid,']');
else
fprintf(fid,',name path=%d]', series_num);
fprintf(fid,',name path=%d]', series_num);
end
end

View File

@ -29,17 +29,17 @@ if length(S) > 1
end
switch S.type
case '.'
switch S.subs
case fieldnames(A)
B.(S.subs) = V;
otherwise
error(['@report_table.subsasgn: field ' S.subs 'does not exist in the report_table class'])
end
case '{}'
assert(isint(S.subs{1}));
B{S.subs{1}} = V;
otherwise
error('@report_table.subsasgn: syntax error')
case '.'
switch S.subs
case fieldnames(A)
B.(S.subs) = V;
otherwise
error(['@report_table.subsasgn: field ' S.subs 'does not exist in the report_table class'])
end
case '{}'
assert(isint(S.subs{1}));
B{S.subs{1}} = V;
otherwise
error('@report_table.subsasgn: syntax error')
end
end

View File

@ -19,24 +19,24 @@ function A = subsref(A, S)
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
switch S(1).type
case '.'
switch S(1).subs
case fieldnames(A)
A = A.(S(1).subs);
case methods(A)
if areParensNext(S)
A = feval(S(1).subs, A, S(2).subs{:});
S = shiftS(S,1);
else
A = feval(S(1).subs, A);
end
otherwise
error(['@report_table.subsref: unknown field or method: ' S(1).subs]);
end
case {'()', '{}'}
error(['@report_table.subsref: ' S(1).type ' indexing not supported.']);
otherwise
error('@report_table.subsref: subsref.m impossible case')
case '.'
switch S(1).subs
case fieldnames(A)
A = A.(S(1).subs);
case methods(A)
if areParensNext(S)
A = feval(S(1).subs, A, S(2).subs{:});
S = shiftS(S,1);
else
A = feval(S(1).subs, A);
end
otherwise
error(['@report_table.subsref: unknown field or method: ' S(1).subs]);
end
case {'()', '{}'}
error(['@report_table.subsref: ' S(1).type ' indexing not supported.']);
otherwise
error('@report_table.subsref: subsref.m impossible case')
end
S = shiftS(S,1);

View File

@ -137,14 +137,14 @@ else
end
fprintf(fid, '\\\\\n');
switch dates.freq
case 4
sep = 'Q';
case 12
sep = 'M';
case 52
sep = 'W';
otherwise
error('@report_table.writeTableFile: Invalid frequency.');
case 4
sep = 'Q';
case 12
sep = 'M';
case 52
sep = 'W';
otherwise
error('@report_table.writeTableFile: Invalid frequency.');
end
for i=1:size(thdr, 1)
period = thdr{i, 2};
@ -179,9 +179,9 @@ for i=1:ne
if o.writeCSV
if isempty(o.series{i}.tableSubSectionHeader)
csvseries = [csvseries ...
o.series{i}.data(dates).set_names([...
num2str(i) '_' ...
o.series{i}.data.name{:}])];
o.series{i}.data(dates).set_names([...
num2str(i) '_' ...
o.series{i}.data.name{:}])];
end
end
if o.showHlines

View File

@ -31,8 +31,8 @@ function o = addParagraph(o, varargin)
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
assert(o.cols == 1, ...
['@addParagraph: you can only add a paragraph to a Section that ' ...
'contains one column']);
['@addParagraph: you can only add a paragraph to a Section that ' ...
'contains one column']);
for i=1:length(o.elements)
assert(isa(o.elements{i}, 'paragraph'), ...
['@addParagraph: you can only add a paragraph to a Section that ' ...

View File

@ -29,22 +29,22 @@ if length(S) > 1
end
switch S.type
case '()'
index = S.subs{:};
assert(isnumeric(index));
B.elements{index} = V;
case '{}'
index = S.subs{:};
assert(isnumeric(index));
B{index} = V;
case '.'
switch S.subs
case fieldnames(A)
B.(S.subs) = V;
otherwise
error(['@section.subsasgn: field ' S.subs 'does not exist']);
end
otherwise
error('@section.subsasgn: syntax error');
case '()'
index = S.subs{:};
assert(isnumeric(index));
B.elements{index} = V;
case '{}'
index = S.subs{:};
assert(isnumeric(index));
B{index} = V;
case '.'
switch S.subs
case fieldnames(A)
B.(S.subs) = V;
otherwise
error(['@section.subsasgn: field ' S.subs 'does not exist']);
end
otherwise
error('@section.subsasgn: syntax error');
end
end

View File

@ -19,26 +19,26 @@ function A = subsref(A, S)
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
switch S(1).type
case '.'
switch S(1).subs
case fieldnames(A)
A = A.(S(1).subs);
case methods(A)
if areParensNext(S)
A = feval(S(1).subs, A, S(2).subs{:});
S = shiftS(S,1);
else
A = feval(S(1).subs, A);
end
otherwise
error(['@section.subsref: unknown field or method: ' S(1).subs]);
end
case '()'
A = A.elements{S(1).subs{:}};
case '{}'
error(['@section.subsref: ' S(1).type ' indexing not supported.']);
otherwise
error('@section.subsref: impossible case')
case '.'
switch S(1).subs
case fieldnames(A)
A = A.(S(1).subs);
case methods(A)
if areParensNext(S)
A = feval(S(1).subs, A, S(2).subs{:});
S = shiftS(S,1);
else
A = feval(S(1).subs, A);
end
otherwise
error(['@section.subsref: unknown field or method: ' S(1).subs]);
end
case '()'
A = A.elements{S(1).subs{:}};
case '{}'
error(['@section.subsref: ' S(1).type ' indexing not supported.']);
otherwise
error('@section.subsref: impossible case')
end
S = shiftS(S,1);

View File

@ -35,7 +35,7 @@ assert(fid ~= -1);
fprintf(fid, '%% Section Object\n');
if isempty(o.elements)
warning(['reporting:section.write(): trying to print a section ' ...
'with no elements. Perhaps you forgot to overwrite the report object.']);
'with no elements. Perhaps you forgot to overwrite the report object.']);
return
end

View File

@ -29,21 +29,21 @@ if length(S) > 1
end
switch S.type
case '()'
index = S.subs{:};
assert(isnumeric(index));
B{index} = V;
case '.'
switch S.subs
case fieldnames(A)
B.(S.subs) = V;
otherwise
error(['@vspace.subsasgn: field ' S.subs 'does not exist']);
end
case '{}'
assert(isint(S.subs{1}));
B{S.subs{1}} = V;
otherwise
error('@vspace.subsasgn: syntax error');
case '()'
index = S.subs{:};
assert(isnumeric(index));
B{index} = V;
case '.'
switch S.subs
case fieldnames(A)
B.(S.subs) = V;
otherwise
error(['@vspace.subsasgn: field ' S.subs 'does not exist']);
end
case '{}'
assert(isint(S.subs{1}));
B{S.subs{1}} = V;
otherwise
error('@vspace.subsasgn: syntax error');
end
end

View File

@ -19,26 +19,26 @@ function A = subsref(A, S)
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
switch S(1).type
case '.'
switch S(1).subs
case fieldnames(A)
A = A.(S(1).subs);
case methods(A)
if areParensNext(S)
A = feval(S(1).subs, A, S(2).subs{:});
S = shiftS(S,1);
else
A = feval(S(1).subs, A);
end
otherwise
error(['@vspace.subsref: unknown field or method: ' S(1).subs]);
end
case '()'
A = getSections(A, S(1).subs{:});
case '{}'
error(['@vspace.subsref: ' S(1).type ' indexing not supported.']);
otherwise
error('@vspace.subsref: impossible case')
case '.'
switch S(1).subs
case fieldnames(A)
A = A.(S(1).subs);
case methods(A)
if areParensNext(S)
A = feval(S(1).subs, A, S(2).subs{:});
S = shiftS(S,1);
else
A = feval(S(1).subs, A);
end
otherwise
error(['@vspace.subsref: unknown field or method: ' S(1).subs]);
end
case '()'
A = getSections(A, S(1).subs{:});
case '{}'
error(['@vspace.subsref: ' S(1).type ' indexing not supported.']);
otherwise
error('@vspace.subsref: impossible case')
end
S = shiftS(S,1);

View File

@ -74,7 +74,7 @@ for i=1:length(fields)
fprintf('<dates: empty>');
else
fprintf('<dates: %s, ..., %s>', ...
date2string(val(1)), date2string(val(end)));
date2string(val(1)), date2string(val(end)));
end
elseif isdseries(val)
if numel(val) == 1

View File

@ -50,7 +50,7 @@ rep = rep.addTable('title', countryName, ...
for i=1:length(seriesNames)
if (any(strcmp(countryAbbr, otherThree)) && ...
any(strcmp(seriesNames{i}{1}, notForOtherThree))) || ...
any(strcmp(seriesNames{i}{1}, notForOtherThree))) || ...
(any(strcmp(countryAbbr, 'US')) && any(strcmp(seriesNames{i}{1}, notForUS))) || ...
(any(strcmp(countryAbbr, firstThree)) && any(strcmp(seriesNames{i}{1}, notForFirstThree)))
continue

View File

@ -202,13 +202,13 @@ rep = rep.addPage('title', {'Jan1 vs Jan2', 'World Oil and Food Prices'}, ...
'titleFormat', {'\large\bfseries', '\large'});
rep = rep.addSection('cols', 1);
rep = rep.addParagraph('text', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', ...
'cols', 2, ...
'heading', '\textbf{My First Paragraph Has Two Columns}');
'cols', 2, ...
'heading', '\textbf{My First Paragraph Has Two Columns}');
rep = rep.addSection('cols', 1);
rep = rep.addParagraph('text', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\newline', ...
'heading', '\textbf{My Next Paragraphs Only Have One}', ...
'indent', false);
'heading', '\textbf{My Next Paragraphs Only Have One}', ...
'indent', false);
rep = rep.addParagraph('text', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\newline');
rep = rep.addSection('cols', 2);