-
Notifications
You must be signed in to change notification settings - Fork 4
/
mkcategory.m
44 lines (34 loc) · 951 Bytes
/
mkcategory.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
%
% Generate the category tabular environment.
%
% PARAMETERS
% $NETWORKS
%
% OUTPUT
% category-tabular.tex
%
OUT = fopen('category-tabular.tex', 'w');
if (0 > OUT)
error('fopen');
end
fprintf(OUT, '\\begin{tabular}{lllllr}\n');
fprintf(OUT, '\\toprule\n');
fprintf(OUT, ['& \\textbf{Category} & \\textbf{Vertices} & \\textbf{Edges} ' ...
'& \\textbf{Properties} & \\textbf{Count} \\\\\n']);
fprintf(OUT, '\\midrule\n');
[colors vertices edges] = konect_data_category();
categories= fieldnames(colors);
n = length(categories)
% Iterate over all networks
for i = 1 : n
category= categories{i}
fprintf(OUT, '\\textcolor{color%s}{$\\newmoon$} &', category);
fprintf(OUT, '%s & ', category);
fprintf(OUT, '%s & %s & ', vertices.(category), edges.(category));
fprintf(OUT, '\\\\\n');
end
fprintf(OUT, '\\bottomrule\n');
fprintf(OUT, '\\end{tabular}\n');
if (0 > fclose(OUT))
error('fclose');
end