summaryrefslogtreecommitdiffstats
path: root/Kod/bilbana/yc4
diff options
context:
space:
mode:
authorGustav Sörnäs <gusso230@student.liu.se>2019-11-19 13:43:13 +0100
committerGustav Sörnäs <gusso230@student.liu.se>2019-11-19 13:43:13 +0100
commitb5fb0790fd8c2820eae6c153bf7cd88beeaa0aa6 (patch)
treeab222ba70500c82418f6275e3272b96ab67a9300 /Kod/bilbana/yc4
parente1ee4a1d66e7576f9d2bb6c659c9d5e79f90921f (diff)
downloadtfyy51-b5fb0790fd8c2820eae6c153bf7cd88beeaa0aa6.tar.gz
Add get_bars_from_values-function
Diffstat (limited to 'Kod/bilbana/yc4')
-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