getAllScenarioVariables
Description
Examples
Get All RoadRunner Scenario Variables Using MATLAB
Create a roadrunner
object, specifying the path to an existing
project. For example, this code shows the path to a project, on a Windows® machine, located at "C:\RR\MyProject"
. This call
assumes that RoadRunner is installed in the default location, and returns an object,
rrApp
, that provides functions for performing basic workflow tasks
such as opening, closing, and saving scenes and
projects.
rrApp = roadrunner(ProjectFolder="C:\RR\MyProject");
Open an existing scenario in the specified project by using the
openScenario
function, specifying the rrApp
object and the specific scenario filename
that you want to open as
inputs.
filename = "MyScenario.rrscenario";
openScenario(rrApp,filename)
Get the values of all variables from the scenario.
values = getAllScenarioVariables(rrApp);
Input Arguments
rrApp
— RoadRunner application
roadrunner
object
RoadRunner application associated with a project, specified as a
roadrunner
object. This object provides functions
for performing common workflow tasks such as opening, closing, and saving scenes and
projects. rrApp
provides functions that support importing data from
files and exporting scenes to other formats from RoadRunner.
Output Arguments
values
— Values of scenario variables
structure array
Values of the scenario variables, returned as a structure array with these fields:
Name
— Name of the variable.Value
— String value of the variable.TypedValue
— Value of the variable as displayed in RoadRunner, such as an integer or double. TheTypedValue
field is empty for unsupported variable types, such as an array.
Example: If the scenario contains a variable called InitialHeading
with a value of -90
,
getAllScenarioVariables(rrApp);
gets all variable names and values
in the scenario currently open in the rrApp
instance of RoadRunner and returns a structure with a Name
of
'UTV_InitialHeading'
, a Value
of
'-90'
and a TypedValue
of
-90
.
Version History
Introduced in R2023b
See Also
roadrunner
| setScenarioVariable
| getScenarioVariable
| close
Topics
- RoadRunner Scenario Fundamentals (RoadRunner Scenario)
- Simulate a RoadRunner Scenario Using MATLAB Functions
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de 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)