Contenu principal

scenario

R2026b

Create 3D scenario

Since R2026b

    Description

    Add-On Required: This feature requires the 3D Scenarios add-on.

    The Scenario object represents a 3D scenario containing a scene, actors, and analyses. Use this object to model, visualize, and simulate scenarios in a 3D geographic environment.

    Creation

    Description

    scnro = scenario creates a 3D scenario. By default, the scene within the scenario uses terrain from the GMTED2010 model, includes no buildings, and has no time limit.

    scnro = scenario(Name=Value) specifies options for the 3D scenario using one or more name-value arguments.

    Name-Value Arguments

    expand all

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: scnro = scenario(StopTime=60) creates a 3D scenario and sets the end time of the simulation to 60 seconds.

    Terrain name, specified as one of these values:

    • "gmted2010" — Tiled global terrain derived from the GMTED2010 model by the U.S. Geological Survey (USGS) and National Geospatial-Intelligence Agency (NGA) and hosted by MathWorks®. This option requires internet access.

    • "none" — No terrain.

    • String scalar or character vector — Name of custom terrain added using the addCustomTerrain function.

    This argument sets the Terrain property of the Scene object that is stored in the Scene property of the scenario.

    Data Types: char | string

    Buildings name, specified as one of these values:

    • "none" — No buildings.

    • String scalar or character vector — Name of custom buildings added using the addCustomBuildings function. When the Terrain property specifies the name of custom terrain added using the addCustomTerrain function, the buildings must be within the bounds of the terrain.

    This argument sets the Buildings property of the Scene object that is stored in the Scene property of the scenario.

    End time of the simulation, in seconds, specified as a positive duration or a positive scalar.

    This argument sets the StopTime property of the Scenario object. When you specify this argument as a numeric value, the object stores the value as a duration value.

    The scenario stops when SimulationTime reaches the value specified in StopTime, or when all actors finish their trajectories.

    Data Types: duration | double

    Properties

    expand all

    This property is read-only.

    Geographic environment for the 3D scenario, represented as a Scene object.

    Specify the terrain and buildings for the scene using the Terrain and Buildings name-value arguments.

    This property is read-only.

    Scenario actors, represented as an m-by-1 array of Actor objects.

    Add actors to a scenario by using functions such as car, aircraft, and actor.

    This property is read-only.

    Current status of the simulation, represented as "notstarted", "running", or "complete".

    This property is read-only.

    Current simulation time, in seconds, represented as a nonnegative duration. This property represents the number of seconds that have elapsed since the start of the simulation.

    To reset the time to zero, use the restart function.

    Data Types: duration

    This property is read-only while the simulation is running.

    End time of the simulation, in seconds, specified as a positive duration or a positive scalar. When you specify a numeric value, the object stores the value as a duration value.

    The scenario stops when SimulationTime reaches the value specified in StopTime, or when all actors finish their trajectories.

    Data Types: duration

    Object Functions

    expand all

    advanceAdvance 3D scenario by one time step
    restartRestart 3D scenario from beginning
    carCreate car actor in 3D scenario
    aircraftCreate aircraft actor in 3D scenario
    actorCreate point actor in 3D scenario
    viewerCreate viewer for 3D scenario
    viewersGet viewers for 3D scenario
    gcvGet current 3D scenario viewer
    analysesGet analyses in 3D scenario

    Version History

    Introduced in R2026b