Main Content


Access and modify runtime specifications of actor

Since R2022a


    A Simulink.ActorSimulation object represents an actor in a scenario simulation. Use a Simulink.ActorSimulation object to:

    • Access and modify the runtime attributes of an actor.

    • Access the actions of an actor in the current simulation time step.


    Retrieve the list of Simulink.ActorSimulation objects from a simulation by using the get function of a Simulink.ScenarioSimulation object. If required, you can then retrieve specific actors.

    Object Functions

    convertToStructConvert actor to MATLAB structure
    getGet scenario or static attribute of actor
    getActionGet actions associated with actor
    getAttributeGet runtime attribute of actor
    setAttributeSet runtime attribute of actor


    Get Actors of Scenario Simulation

    Create Sim, a Simulink.ScenarioSimulation object.

    rrApp = roadrunner('C:\RoadRunnerProject');
    Sim = createSimulation(rrApp);

    Start the simulation.


    Get all actors while the simulation runs.

    actorSim = get(Sim, 'ActorSimulation');

    Get the first actor only.

    actorOne = actorSim(1);

    Version History

    Introduced in R2022a