Help CenterHelp Center
Get scenario or static attribute of actor
Since R2022a
staticAttr = get(actorSim,'ActorModel')
scenario = get(actorSim,'ScenarioSimulation')
example
staticAttr = get(actorSim,'ActorModel') gets the static attributes of the actor specified by actorSim.
staticAttr
actorSim
scenario = get(actorSim,'ScenarioSimulation') gets the scenario simulation containing the actor specified by actorSim.
scenario
collapse all
Create sim, a Simulink.ScenarioSimulation object.
sim
Simulink.ScenarioSimulation
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.
actorOne
staticAttr = get(actorOne,'ActorModel')
Get the simulation containing actorOne.
scenario = get(actorOne,'ScenarioSimulation')
Simulink.ActorSimulation
Actor, specified as a Simulink.ActorSimulation object.
Example: staticAttr = get(actorSim,'ActorModel')
Simulink.ActorModel
Static attributes of actor, returned as a Simulink.ActorModel object.
Scenario simulation containing actor, returned as a Simulink.ScenarioSimulation object.
Introduced in R2022a
Simulink.ActorSimulation | Simulink.ActorModel | Simulink.ScenarioSimulation
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office