主要内容

ScenarioDescriptorPlot

Scenario descriptor plot properties

Since R2026a

Description

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

The ScenarioDescriptorPlot object contains properties you can use to plot and simulate the scenario obtained from a scenario descriptor object. To configure the properties of the ScenarioDescriptorPlot object, use the configure object function. To plot a specific frame of the scenario simulation, use the seek object function. To instead play the entire scenario simulation, use the play object function.

Creation

Create a ScenarioDescriptorPlot object by using the plot function.

Properties

expand all

This property is read-only.

Current simulation time, represented as a nonnegative scalar. Units are in seconds.

Data Types: double

This property is read-only.

Maximum time of the scenario simulation, represented as a nonnegative scalar. Units are in seconds. The play and seek object functions stop when the SimulationTime property value equals this value.

Data Types: double

This property is read-only.

Number of input scenario descriptors, represented as a positive integer.

Data Types: double

Figure handles, returned as an M-element array of Figure objects. M is the number of figures created by the plot function. You can use the figure handle to query and modify figure properties. For more information, see Figure.

Actor waypoint visibility, specified as "on", "off", or "StartEnd".

  • "on" — The plot displays all waypoints of the actor trajectory.

  • "off" — The plot does not display any waypoints of the actor trajectory.

  • "StartEnd" — The plot displays only the start and end waypoints of the actor trajectory.

Note

To set this property, use the Waypoints name-value argument of the configure object function.

Scenario crop method, specified as one of these options:

  • "None" — Plotting or simulating the scenario does not crop it.

  • "GlobalWaypoint" — Plotting or simulating the scenarios crops them with reference to all waypoints of the scenarios in the input scenario descriptor.

  • "DynamicWaypoint" — Plotting or simulating the scenario crops it with reference to the actor waypoints in that scenario.

  • "RuntimeActorsCrop" — Plotting or simulating the scenario crops it around the actor during simulation runtime.

Note

To set this property, use the CropType name-value argument of the configure object function.

x-axis limits, specified as a two-element row vector of form [min max].

Note

To set this property, use the XLimit name-value argument of the configure object function.

Data Types: double

y-axis limits, specified as a two-element row vector of form [min max].

Note

To set this property, use the YLimit name-value argument of the configure object function.

Data Types: double

z-axis limits, specified as a two-element row vector of form [min max].

Note

To set this property, use the ZLimit name-value argument of the configure object function.

Data Types: double

Title of the plot or scenario simulation, represented as a string scalar.

Note

To set this property, use the Title name-value argument of the configure object function.

Data Types: string

Subtitles of the plot or the scenario simulation, represented as a string scalar or an M-element string array. M is the number of input scenario descriptors.

Note

To set this property, use the SubPlotTitles name-value argument of the configure object function.

Data Types: string

Grid size in which to display the scenarios, specified as a two-element row vector of the form [nrows ncols].

Note

To set this property, use the GridSize name-value argument of the configure object function.

Data Types: uint8 | uint16 | uint32 | uint64 | double

Object Functions

configureConfigure options for plotting or simulating scenarios
playPlay scenario simulation from scenario descriptor
seekSeek and plot scenario frame in scenario descriptor
closeClose scenario descriptor plot figure

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)

Limitations

Version History

Introduced in R2026a