Variable-sized arrays
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello,
how could I define variable sized data generation in my code?
I would like to extract actor data from "automated driving toolbox "- generated scenarios based on the numbers of different actors. The following code extracts the data, which is needed in my case, but has to be changed when it comes to different scenarios with varying actor amounts.
%
%% Vehicle1 EGO VEHICLE
Position2 = repmat(data.ActorSpecifications(1, 2).Position, p, 1);
Yaw2 = repmat(data.ActorSpecifications(1, 2).Yaw, p, 1);
Velocity2= repmat(data.ActorSpecifications(1, 2).Speed, p,1);
%Vehicle3
Position3 = repmat(data.ActorSpecifications(1, 3).Position, p, 1);
Yaw3 = repmat(data.ActorSpecifications(1, 3).Yaw, p, 1);
Velocity3= repmat(data.ActorSpecifications(1, 3).Speed, p,1);
%Vehicle4
Position4 = repmat(data.ActorSpecifications(1, 4).Position, p ,1);
Yaw4 = repmat(data.ActorSpecifications(1, 4).Yaw, p, 1) ;
Velocity4= repmat(data.ActorSpecifications(1, 4).Speed, p,1);
f1= 'Position'; v1= {Position2, Position3, Position4};
f2= 'Yaw'; v2= {Yaw2, Yaw3, Yaw4};
f3= 'Velocity'; v3= {Velocity2, Velocity3, Velocity4};
f4= 'SimulationTime'; v4= SimTime;
otherVehicles = struct(f1, v1, f2, v2, f3, v3, f4, v4);
I would like to eliminate the manual work for data generation. Any ideas, how this could be done?
Thank you in advance.
Best regards
Alexander
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Programmatic Scenario Authoring에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!