saveScenario
Description
Examples
Save Scenario
Save a scenario in RoadRunner Scenario using MATLAB.
Start RoadRunner and open the project called "C:\RR\MyProject".
Return the RoadRunner application object in rrApp
. This example assumes that RoadRunner is installed in its default location in Windows. This call returns an object rrApp
that provides functions for performing basic workflow tasks such as opening, closing, and saving scenes and projects.
projectFolder = "C:\RR\MyProject";
rrApp = roadrunner(projectFolder);
Open an existing scenario in RoadRunner Scenario by calling the openScenario
function and passing it the rrApp
object and the specific scenario filename
that you want to open. This call opens the desired scenario in the RoadRunner Scenario application through MATLAB.
filename = "MyScenario.rrscenario";
openScenario(rrApp,filename);
Save the scenario to another file. Call the saveScenario
function and pass it the rrApp
object and the new filename with which you want to save the scenario. This call saves the scenario, the current scene and the project.
newFilename = "MyScenario1.rrscenario";
saveScenario(rrApp,newFilename);
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.
filename
— RoadRunner scenario file name
character vector | string scalar
RoadRunner scenario file name, specified as a character vector or string scalar. If
you specify this argument as a relative path, then the path is relative to the
Scenarios
folder of the current project. If you do not specify
filename
, then RoadRunner saves the current scenario to its existing file. If you do not have a
current scenario open, then RoadRunner returns an error. RoadRunner recursively creates any folders on the specified file path that do not
already exist.
filename
must end with .rrscenario
extension
or have no extension. If it has no extension, then RoadRunner appends the .rrscenario
extension to the file name
before saving the scenario. If the file being saved already exists, then RoadRunner overwrites it.
Example:
saveScenario(rrApp,"MyScenario1.rrscenario")
saves the current open
scenario to the MyScenario1.rrscenario
file in to the
Scenarios
folder of the current project.
Data Types: char
| string
Version History
Introduced in R2022a
See Also
roadrunner
| newScenario
| openScenario
| close
Topics
- RoadRunner Scenario Fundamentals (RoadRunner Scenario)
- Simulate a RoadRunner Scenario Using MATLAB Functions
MATLAB Command
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.
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)