set
Set value of scenario simulation parameter
Description
set(
sets the value of the specified parameter in the
ScenarioSim
,Name=Value
) Simulink.ScenarioSimulation
object
ScenarioSim
.
Examples
Set Scenario Simulation Parameters
Create ss
, a
Simulink.ScenarioSimulation
object
rrApp = roadrunner('C:\Project\TestHighwayRoute'); openScenario(rrApp,'myScenario1'); ss = createSimulation(rrApp);
Set the simulation step size.
set(ss,StepSize=0.02)
Set the maximum simulation time.
set(ss,MaxSimulationTime=1200)
Set the simulation pacer status.
set(ss,PacerStatus='on')
Set the simulation pace.
set(ss,SimulationPace=1)
Set command to pause the simulation.
set(ss,SimulationCommand='Pause')
Turn on logging for the simulation.
set(ss,Logging='On')
Input Arguments
ScenarioSim
— RoadRunner Scenario simulation
Simulink.ScenarioSimulation object
RoadRunner Scenario simulation, specified as a Simulink.ScenarioSimulation
object.
Example: set(ss,MaxSimulationTime=1000)
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: set(ss,SimulationCommand='Start')
starts playing the
specified simulation.
StepSize
— Step size of the simulation
double
Step size of the simulation in seconds, specified as a double. The default value is 0.02 seconds.
MaxSimulationTime
— Maximum simulation time
double
Maximum simulation time in seconds, specified as a double. The default value is 1000 seconds.
PacerStatus
— Pacer status of the simulation
On | Off
Pacer status of the simulation, specified as one of these strings.
On
— Pacing is turned on. You can slow down or speed up the simulation.Off
— Pacing is turned off. You cannot slow down or speed up the simulation.
SimulationPace
— Pace of the simulation
double
Pace of the simulation, specified as a double. Indicates speed of the simulation run.
Logging
— Logging status of the simulation
On | Off
Logging status of the simulation, specified as one of these strings.
On
— Logging is turned on. You can retrieve simulation and actor information at each time step.Off
— Logging is turned off. You cannot retrieve simulation and actor information at each time step.
SimulationCommand
— Command to control simulation
Start | Pause | Continue | Stop
Command to control simulation, specified as one of these strings.
Start
— Start playing an unstarted or stopped simulation.Pause
— Pause a running simulation.Continue
— Continue playing a paused simulation.Stop
— Stop playing a running or paused simulation.
Version History
Introduced in R2022a
See Also
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは 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)