主要内容

plot

Plot scenario descriptor

Since R2026a

Description

Add-On Required: This feature requires the Automated Driving Toolbox Test Suite for Euro NCAP Protocols add-on.

plot(descriptor) plots the first frame of the scenario simulation from the input scenario descriptor object descriptor.

scenarioDescriptorPlotObj = plot(descriptor) returns a ScenarioDescriptorPlot object, scenarioDescriptorPlotObj, that contains the data to plot and the simulate scenario from the input scenario descriptor object descriptor.

example

Examples

collapse all

Load a driving scenario into the workspace.

load("scenarioWithSingleActor.mat")

Create a scenario descriptor from the loaded driving scenario.

scenarioDescriptor = getScenarioDescriptor(sc);

Plot the first frame of the scenario simulation from the scenario descriptor object.

plot(scenarioDescriptor)

Create a scenario descriptor plot object from the scenario descriptor object.

scenarioDescriptorPlotObj = plot(scenarioDescriptor)
scenarioDescriptorPlotObj = 
  ScenarioDescriptorPlot with properties:

       SimulationTime: 0
    MaxSimulationTime: 0.9300

       NumDescriptors: 1
        FigureHandles: [1×1 Figure]

            Waypoints: "StartEnd"
             CropType: "None"
               XLimit: []
               YLimit: []
               ZLimit: []
                Title: "Figure"
        SubPlotTitles: "Scenario"
             GridSize: []

Configure the scenario descriptor plot object to change the title.

configure(scenarioDescriptorPlotObj,Title="Straight Road")

Play the entire scenario simulation, instead of displaying only the first frame of the scenario.

play(scenarioDescriptorPlotObj)

Close the scenario descriptor plot.

close(scenarioDescriptorPlotObj)

Load a MAT file containing two scenario descriptors.

load("scenarioDescriptors")

Plot the first frames of the scenario simulations for both loaded scenario descriptors in a single figure.

scenarioDescriptorPlotObj = plot(scenarioDescriptors)

scenarioDescriptorPlotObj = 
  ScenarioDescriptorPlot with properties:

       SimulationTime: [2×1 double]
    MaxSimulationTime: [2×1 double]

       NumDescriptors: 2
        FigureHandles: [1×1 Figure]

            Waypoints: "StartEnd"
             CropType: "None"
               XLimit: []
               YLimit: []
               ZLimit: []
                Title: "Figure"
        SubPlotTitles: ["Scenario #1"    "Scenario #2"]
             GridSize: []

Configure the scenario descriptor plot object to change the title and subplot titles.

configure(scenarioDescriptorPlotObj,Title="Scenarios",SubPlotTitles=["Curved Road" "Straignt Road"])

Play the entirety of both scenario simulations, instead of displaying only the first frame of each.

play(scenarioDescriptorPlotObj)

Close the scenario descriptor plot.

close(scenarioDescriptorPlotObj)

Input Arguments

collapse all

Scenario descriptor, specified as a ScenarioDescriptor object or an N-element array of ScenarioDescriptor objects. The ScenarioDescriptor object stores scene, actor, and vehicle information extracted from a seed scenario, and uses this information to generate scenario variants. You can use these scenario variants to perform safety assessments for various automated driving applications.

Output Arguments

collapse all

Scenario descriptor plot data, returned as a ScenarioDescriptorPlot object.

Limitations

Version History

Introduced in R2026a