-
Notifications
You must be signed in to change notification settings - Fork 18
/
ms2tex.m
32 lines (29 loc) · 1.19 KB
/
ms2tex.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
function t = ms2tex(mean_val, std_val, ismax, sigs, sigs2, prefix)
if ~exist('ismax', 'var')
ismax = 1;
end
sigs(isnan(sigs)) = 0; % failed to reject a=b, nan means a = b, of course sigs = 0
sigs2(isnan(sigs2)) = 1.0;
n = length(mean_val);
t = prefix;
if ismax
[~, idx] = max(mean_val);
else
[~, idx] = min(mean_val);
end
for i1 = 1:n
if isempty(sigs2)
if i1 == idx
t = [t, '& \tabincell{c}{ \textbf{', num2str(mean_val(i1) * 100, '%4.2f'), '} \\ \textbf{$\pm$ ', num2str(std_val(i1) * 100, '%4.2f'), '}} '];
else
t = [t, '& \tabincell{c}{ ', num2str(mean_val(i1) * 100, '%4.2f'), ' \\ $\pm$ ', num2str(std_val(i1) * 100, '%4.2f'), '} '];
end
else
if sigs(i1) == 0
t = [t, '& \tabincell{c}{ \textbf{', num2str(mean_val(i1) * 100, '%4.2f'), '} \\ \textbf{$\pm$ ', num2str(std_val(i1) * 100, '%4.2f'), ' } \\ \textbf{', num2str(sigs2(i1), '%4.2f'), ' }} '];
else
t = [t, '& \tabincell{c}{ ', num2str(mean_val(i1) * 100, '%4.2f'), ' \\ $\pm$ ', num2str(std_val(i1) * 100, '%4.2f'), ' \\', num2str(sigs2(i1), '%4.2f'), ' } '];
end
end
end
t = [t, '\\ \hline'];