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
Dóra Kocsis
dynare
Commits
12b2b96a
Commit
12b2b96a
authored
Mar 14, 2013
by
Houtan Bastani
Browse files
reporting: allow selection of series in table
parent
2116ab0f
Changes
1
Hide whitespace changes
Inline
Side-by-side
matlab/reports/@table/write.m
View file @
12b2b96a
...
@@ -34,6 +34,12 @@ if isempty(o.data)
...
@@ -34,6 +34,12 @@ if isempty(o.data)
return
return
end
end
if
strcmpi
(
o
.
seriestouse
,
'all'
)
ds
=
o
.
data
;
else
ds
=
o
.
data
{
o
.
seriestouse
{:}};
end
%number of left-hand columns, 1 until we allow the user to group data,
%number of left-hand columns, 1 until we allow the user to group data,
% e.g.: GDP Europe
% e.g.: GDP Europe
% GDP France
% GDP France
...
@@ -45,7 +51,7 @@ disp('creating table.........');
...
@@ -45,7 +51,7 @@ disp('creating table.........');
fprintf
(
fid
,
'%% Table Object\n'
);
fprintf
(
fid
,
'%% Table Object\n'
);
fprintf
(
fid
,
'\\begin{tabular}{l'
);
fprintf
(
fid
,
'\\begin{tabular}{l'
);
dates
=
o
.
data
.
time
;
dates
=
ds
.
time
;
ndates
=
dates
.
ndat
;
ndates
=
dates
.
ndat
;
for
i
=
1
:
ndates
for
i
=
1
:
ndates
...
@@ -57,6 +63,7 @@ if ~isempty(o.title)
...
@@ -57,6 +63,7 @@ if ~isempty(o.title)
end
end
fprintf
(
fid
,
'\\toprule%%\n'
);
fprintf
(
fid
,
'\\toprule%%\n'
);
% Column Headers
datedata
=
dates
.
time
;
datedata
=
dates
.
time
;
years
=
unique
(
datedata
(:,
1
));
years
=
unique
(
datedata
(:,
1
));
thdr
=
num2cell
(
years
,
size
(
years
,
1
));
thdr
=
num2cell
(
years
,
size
(
years
,
1
));
...
@@ -111,9 +118,10 @@ switch dates.freq
...
@@ -111,9 +118,10 @@ switch dates.freq
end
end
fprintf
(
fid
,
'%%\n'
);
fprintf
(
fid
,
'%%\n'
);
vars
=
o
.
data
.
name
;
% Table Data
vars
=
ds
.
name
;
nvars
=
size
(
vars
);
nvars
=
size
(
vars
);
data
=
o
.
data
.
data
;
data
=
ds
.
data
;
assert
(
isint
(
o
.
precision
));
assert
(
isint
(
o
.
precision
));
precision
=
10
^
o
.
precision
;
precision
=
10
^
o
.
precision
;
dataString
=
[
' & %.'
num2str
(
o
.
precision
)
'f'
];
dataString
=
[
' & %.'
num2str
(
o
.
precision
)
'f'
];
...
...
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