diff options
| author | Albin <albwa833@student.liu.se> | 2019-11-16 14:25:40 +0100 |
|---|---|---|
| committer | Albin <albwa833@student.liu.se> | 2019-11-16 14:25:40 +0100 |
| commit | f3819da0232f8f1877b25a3f166174de7134ba8c (patch) | |
| tree | 1ebde1f25810202a9d185166c803194694a99a54 /Kod | |
| parent | 378f12b0132d9aef7a7e429f3eb0430219fb88f5 (diff) | |
| download | tfyy51-f3819da0232f8f1877b25a3f166174de7134ba8c.tar.gz | |
Lade till get_seg_constant.m
Diffstat (limited to 'Kod')
| -rw-r--r-- | Kod/bilbana/yc4/get_new_v.m | 6 | ||||
| -rw-r--r-- | Kod/bilbana/yc4/get_seg_constant.m | 13 |
2 files changed, 14 insertions, 5 deletions
diff --git a/Kod/bilbana/yc4/get_new_v.m b/Kod/bilbana/yc4/get_new_v.m index e722326..e56f572 100644 --- a/Kod/bilbana/yc4/get_new_v.m +++ b/Kod/bilbana/yc4/get_new_v.m @@ -4,12 +4,8 @@ function [ new_v ] = get_new_v( position, list) Utgår ifrån position och ger motsvarande hårdkodade värde på v för nuvarande sub_segment. %} -position = position*100; %temp input för position - - - +position = position*100; for i = 1:length(list) - if list(i,1) > position new_v = list((i-1),4); break diff --git a/Kod/bilbana/yc4/get_seg_constant.m b/Kod/bilbana/yc4/get_seg_constant.m new file mode 100644 index 0000000..38e0bf0 --- /dev/null +++ b/Kod/bilbana/yc4/get_seg_constant.m @@ -0,0 +1,13 @@ +function [out] = get_seg_constant(position, track) +%GET_SEG_CONSTANT Summary of this function goes here +% Detailed explanation goes here +track_len = [0 2.53 3.05 4.73 7.68 8.98 10.93 14.96 17.57; + 0 2.53 3.05 4.92 7.60 8.84 10.65 14.68 17.76]; +for i = 1:length(track_len) + if position > track_len(track, i) + seg_constant = track_len(track, i); + end +end +out = seg_constant; +end + |
