%% Update Driving Scenario Plots
% Update driving scenario plots after changing aspects of the scenario.
% Create a driving scenario containing a vehicle on a straight, 25-meter road segment. Plot the scenario.

scenario = drivingScenario;
roadcenters = [0 0 0; 25 0 0];
road(scenario,roadcenters);
  
v = vehicle(scenario,'ClassID',1);
v.Position = [1 0 0];

plot(scenario)

% Use a chase plot to plot the scenario from the perspective of the vehicle.

chasePlot(v)

%
% Set a new position for the vehicle.

v.Position = [12 0 0];

%
% Update both plots to show the new position of the vehicle.

updatePlots(scenario)

% Copyright 2018 The MathWorks, Inc.