Main Content

get

Get scenario or static attribute of actor

Since R2022a

    Description

    example

    staticAttr = get(actorSim,'ActorModel') gets the static attributes of the actor specified by actorSim.

    example

    scenario = get(actorSim,'ScenarioSimulation') gets the scenario simulation containing the actor specified by actorSim.

    Examples

    collapse all

    Create sim, a Simulink.ScenarioSimulation object.

    rrApp = roadrunner('C:\Project\TestHighwayRoute'); 
    openScenario(rrApp,'myScenario1'); 
    sim = createSimulation(rrApp);

    Start the simulation.

    set(sim,'SimulationCommand','Start');

    Pause the simulation.

    set(sim,'SimulationCommand','Pause');

    Retrieve all actors from the simulation.

    actorsim = get(sim,'ActorSimulation'); 
    

    Get the first actor in the list.

    actorOne = actorsim(1);

    Get the static specifications of actorOne.

    staticAttr = get(actorOne,'ActorModel')

    Get the simulation containing actorOne.

    scenario = get(actorOne,'ScenarioSimulation')

    Input Arguments

    collapse all

    Actor, specified as a Simulink.ActorSimulation object.

    Example: staticAttr = get(actorSim,'ActorModel')

    Output Arguments

    collapse all

    Static attributes of actor, returned as a Simulink.ActorModel object.

    Scenario simulation containing actor, returned as a Simulink.ScenarioSimulation object.

    Version History

    Introduced in R2022a