summaryrefslogtreecommitdiffstats
path: root/Kod/bilbana
diff options
context:
space:
mode:
Diffstat (limited to 'Kod/bilbana')
-rw-r--r--Kod/bilbana/yc4/display/get_bars_from_values.m22
1 files changed, 22 insertions, 0 deletions
diff --git a/Kod/bilbana/yc4/display/get_bars_from_values.m b/Kod/bilbana/yc4/display/get_bars_from_values.m
new file mode 100644
index 0000000..ff08075
--- /dev/null
+++ b/Kod/bilbana/yc4/display/get_bars_from_values.m
@@ -0,0 +1,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