Export scenario simulation data to a video file 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 code assumes that RoadRunner is installed in the default location, and returns an object, rrApp, that provides functions for performing basic tasks such as opening, closing, and saving scenes and projects.
Note: If you are opening RoadRunner from MATLAB® for the first time, or if you have changed the RoadRunner installation location since you last opened it from MATLAB, you can use the roadrunnerSetup (RoadRunner) function to specify new default project and installation folders to use when opening RoadRunner. You can save these folders between MATLAB sessions by selecting the Across MATLAB sessions option from the corresponding drop down.
Open the TrajectoryCutIn.rrscenario scenario in RoadRunner Scenario by using the openScenario function. This scenario is included by default in RoadRunner projects, and is located in the Scenarios folder of the project.
Run the simulation by using the simulateScenario function, and set EnableLogging to true to enable RoadRunner Scenario to log the simulation data.
Export the simulation data by using the exportVideo function, specifying the rrApp object. Specify the folder path and the filename to which you want to export the video file using the VideoFolder and FileName name-value arguments, respectively. Once the simulation is complete, RoadRunner exports the video file to the specified export folder. You can now navigate to the export folder and locate the video file.