get
Description
returns the value of the specified parameter param
= get(ScenarioSim
,'Param
')Param
from a scenario
simulation ScenarioSim
at runtime.
Examples
Get Specified Parameter Value
Create ss
, a
Simulink.ScenarioSimulation
object.
rrApp = roadrunner('C:\Project\TestHighwayRoute'); openScenario(rrApp,'myScenario1'); ss = createSimulation(rrApp);
Get the current simulation status.
simstatus = get(ss,'SimulationStatus')
Get the log data history associated with the simulation.
loggeddata = get(ss,'SimulationLog')
Get all actors from a scenario.
actors = get(ss,'ActorSimulation')
Get a specific actor using its corresponding Simulink model handle.
actorsim = get(ss,'ActorSimulation', 'SimulinkModel', mdHdl)
Get a specific actor using the System object™ that represents its runtime behavior. This operation is possible only if an actor is already associated with a MATLAB® System object.
actorsysobj = get(ss,'ActorSimulation', 'SystemObject', obj)
Get a specific actor using its corresponding Simulink.ActorModel
object name.
actormod = get(ss,'ActorSimulation', 'ActorModel', actorModel)
Retrieve all the sensors from the simulation.
sensors = get(ss,'SensorSimulation');
Input Arguments
ScenarioSim
— RoadRunner Scenario simulation
Simulink.ScenarioSimulation
object
RoadRunner Scenario simulation, specified as a Simulink.ScenarioSimulation
object.
Example: simstatus = get(ScenarioSim,'SimulationStatus')
Param
— Scenario simulation parameter
StepSize
| MaxSimulationTime
| PacerStatus
| SimulationPace
| SimulationStatus
| SimulationLog
| ActorSimulation
Scenario simulation parameter, specified as one of these string values.
Parameter | Description |
---|---|
'StepSize' | Step size of simulation |
'MaxSimulationTime' | Maximum simulation time of scenario |
'PacerStatus' | Pacer status of simulation |
'SimulationPace' | Pace of simulation |
'SimulationStatus' | Status of simulation |
'SimulationLog' | Logged simulation data |
'ActorSimulation' | Actors in simulation |
'ActorSimulation', 'SimulinkModel', mdHdl | Actor in simulation corresponding to specified Simulink model handle |
'ActorSimulation', 'SystemObject', obj | Actor in simulation corresponding to specified System object |
'ActorSimulation', 'ActorModel', actorModel | Actor in simulation corresponding to specified
Simulink.ActorModel object |
'SensorSimulation' | Sensors in simulation |
Example: simpace =
get(ScenarioSim,'SimulationPace')
Output Arguments
param
— Value of parameter
double | char | Simulink.ScenarioLog
object | Simulink.ActorSimulation
object
Value of parameter, returned as one of these data types.
Parameter | Data Type of Output |
---|---|
'StepSize' | double |
'MaxSimulationTime' | double |
'PacerStatus' | char or string |
'SimulationPace' | double |
'SimulationStatus' | char or string |
'SimulationLog' | Simulink.ScenarioLog object |
'ActorSimulation' | Simulink.ActorSimulation object |
'ActorSimulation', 'SimulinkModel', mdHdl | Simulink.ActorSimulation object |
'ActorSimulation', 'SystemObject', obj | Simulink.ActorSimulation object |
'ActorSimulation', 'ActorModel', actorModel | Simulink.ActorSimulation object |
'SensorSimulation' | SensorSimulation object |
Version History
Introduced in R2022a
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
Select a Web Site
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:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)