summaryrefslogtreecommitdiffstats
path: root/Kod/bilbana/yc4/get_new_v.m
blob: e56f57228dfc6a1a1612f520b97f020f753e76f0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function [ new_v ] = get_new_v( position, list)
%GET_NEW_V Hastigheten som bilen ska få nästa cykel.
%{
Utgår ifrån position och ger motsvarande hårdkodade värde på v för
nuvarande sub_segment.
%}
position = position*100;
for i = 1:length(list)
    if list(i,1) > position
        new_v = list((i-1),4);
        break
    elseif i == length(list)
        new_v = list(80,4);
        break
    end  
end