diff options
| author | Gustav Sörnäs <gusso230@student.liu.se> | 2019-11-23 22:01:16 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gusso230@student.liu.se> | 2019-11-23 22:01:16 +0100 |
| commit | fb66785644345d64ac27f53a8ba9b356b363b1cd (patch) | |
| tree | 241e5b79eacf0502928cfc8f073afebcdc2c1f12 /Kod | |
| parent | f43db367ecbc2fe0bf2f787e085ed76edbe44898 (diff) | |
| download | tfyy51-fb66785644345d64ac27f53a8ba9b356b363b1cd.tar.gz | |
Strip empty values from laps
Diffstat (limited to 'Kod')
| -rw-r--r-- | Kod/bilbana/yc4/display/scenes/draw_lap_graph.m | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Kod/bilbana/yc4/display/scenes/draw_lap_graph.m b/Kod/bilbana/yc4/display/scenes/draw_lap_graph.m index 704dee0..ec7d6dc 100644 --- a/Kod/bilbana/yc4/display/scenes/draw_lap_graph.m +++ b/Kod/bilbana/yc4/display/scenes/draw_lap_graph.m @@ -6,6 +6,24 @@ if isempty(car1_laptimes) car2_laptimes = []; end + +%% strip empty values +tmp = []; +for i = 1:length(car1_laptimes) + if car1_laptimes(i) ~= 0 + tmp = [tmp car1_laptimes(i)]; + end +end +car1_laptimes = tmp; + +tmp = []; +for i = 1:length(car2_laptimes) + if car2_laptimes(i) ~= 0 + tmp = [tmp car2_laptimes(i)]; + end +end +car2_laptimes = tmp; + % laps = max(length(graphs.car1.lap_times), length(graphs.car2.lap_times)); pause(dt); |
