Simulink.ActorSimulation
Access and modify runtime specifications of actor
Description
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.
Creation
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
convertToStruct | Convert actor to MATLAB structure |
get | Get scenario or static attribute of actor |
getAction | Get actions associated with actor |
getAttribute | Get runtime attribute of actor |
setAttribute | Set runtime attribute of actor |
Examples
Get Actors of Scenario Simulation
Create Sim
, a Simulink.ScenarioSimulation
object.
rrApp = roadrunner('C:\RoadRunnerProject'); openScenario(rrApp,'TrajectoryCutIn'); Sim = createSimulation(rrApp);
Start the simulation.
set(Sim,'SimulationCommand','Start');
Get all actors while the simulation runs.
actorSim = get(Sim, 'ActorSimulation');
Get the first actor only.
actorOne = actorSim(1);
Version History
Introduced in R2022a