Generate MATLAB Scripts for Simulation with Scenarios - MATLAB & Simulink (original) (raw)
Main Content
After associating a scenario with the model, you can generate a MATLABĀ® script to perform batch simulations. These scripts enable you to connect multiple sets of input signals to your SimulinkĀ® model for interactive or batch simulation. You can run simulations multiple times and quickly generate data. This topic assumes that you have a scenario ready to run (see Root Inport Mapping Scenarios).
- Associate your scenario with the model.
- In the Script section, click Generate Script and supply a script name when prompted. This command generates the batch simulation file and opens it in MATLAB Editor.
- To run the script, in the MATLAB Editor, click Run.
- To evaluate the results of the simulation, see the base workspace.
The resulting script uses the Simulink.SimulationInput object and parsim function.