blob: ff08075e84148c7415a5a87c1e59fe45c7b7c834 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
function bars = get_bars_from_values(values1, values2)
bars = [];
for i = 1:9
bar = struct;
bar.x_lo = 16 + 13 + (30 * i);
bar.x_hi = bar.x_lo;
bar.y_lo = 200;
bar.y_hi = round(152 * (values1(i) / max(values1)));
if isempty(values2)
bar.x_hi = bar.x_lo + 20;
bars = [bars bar1]
else
bar.x_hi = bar.x_lo + 10;
bar2 = struct;
bar2.x_lo = bar.x_lo + 10;
bar2.x_hi = bar2.x_hi + 10;
bar2.y_lo = 200;
bar2.y_hi = round(152 * (values2(i) / max(values2)));
bars = [bars bar1 bar2]
end
end
end
|