blob: e722326b6dfc891bf4b88a8c07abdb784e706e40 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
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; %temp input för position
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
|