Plotting many vehicle trajectories together in one plot

6 visualizaciones (últimos 30 días)
ADJE JEREMIE ALAGBE
ADJE JEREMIE ALAGBE el 19 de Jul. de 2021
Comentada: ADJE JEREMIE ALAGBE el 21 de Jul. de 2021
I have a dataset that seems to have some similarities with @Himanish Basu's dataset, but when I tried to apply @Walter Roberson's solution to my dataset it didn't give me something meaningful, so I guess my dataset needs some pre-processing first in order to be able to apply that solution or I definitly need another code to deal with the type of data I have.
The dataset is attached in excel file. It's a set of data collected at a section of a freeway road by radar detector. It has 9 columns as follows: deviceno (the number given to each device, radar, here there is only one radar which is numbered 76), timestamp (at every second, the radar detects all vehicles in the detection area and collects their information, including each vehicle's position, speed, and attributes an id to each vehicle, which means same instant or timestamp can contain many vehicles, and a same vehicle can be detected in the next second if it's still in the detection area), unixtime, ID (each vehicle is given an id by the radar; the vehicles are circularly number from 1 to 255, which means after the number reaches 255 it restarts numbering the following vehicles from 1 to 255, and so on), Length (vehicle length), YPos (the vehicle's Y-coordinate in the radar coordinate system, with radar as origin), XPos (the vehicle's X-coordinate), YSpeed (the vehicle's speed in Y-direction), and XSpeed (the vehicle's speed in X-direction).
What I want to do for now is to visualize the vehicles' trajectories in that section of road by plotting each vehicle trajectory together with others in the same plot using X- and Y-coordinates.
I will appreciate a solution from you to my problem. Thank you!
  3 comentarios
ADJE JEREMIE ALAGBE
ADJE JEREMIE ALAGBE el 20 de Jul. de 2021
Yes, but it couldn't solve my problem. Is there any help you can offer that applies to the data type I have?
Actually, I tried to plot only the trajectories for the firt 1-255 period of ID (see dataset attached 15_device76_1.xlsx) by using the fllowing code. It works perfectly, however I don't know how to continue to plot all the other successive 1-255 periods of ID on the same plot.
T = readtable('15_device76_1.xlsx');
N = max(T.ID)
hold on
for k = 1:N
Tk = T(T.ID == k,:);
plot(Tk.yPos, Tk.XPos)
end
hold off
xlabel('y')
ylabel('x')
ADJE JEREMIE ALAGBE
ADJE JEREMIE ALAGBE el 21 de Jul. de 2021
Hi, can someone give an idea on this?

Iniciar sesión para comentar.

Respuestas (0)

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by