-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain_B_PlotTrajectory.m
More file actions
43 lines (25 loc) · 977 Bytes
/
Main_B_PlotTrajectory.m
File metadata and controls
43 lines (25 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
function Main_B_PlotTrajectory
clear;
clc;
%% configuration
Config = Z_Setup('B');
%% simulation record
load([Config.pathOfData num2str(Config.VehNumber_Lane) '.mat'], 'Record_All');
%%
for laneID = 1:1:Config.LaneNumber
figure(laneID);
for vehID = 1:1:Config.VehNumber_Lane*Config.LaneNumber
[~, c] = find(Record_All.LaneID(vehID, :) == laneID);
Position_Lane = Record_All.Position(vehID, c);
Time = 1:1:Config.TimeMax;
Time_Lane = Time(1,c);
colorOfVehicle = [rand() rand() rand()];
plot(Time_Lane, Position_Lane, '.', 'color', colorOfVehicle, 'markersize', 1); hold on;
end
%%
set(gca, 'FontSize', 18);
xlabel('Time');
ylabel('Position (m)');
set(gcf,'Position',[50,400,1800,400]);
end
end