Run Multiple Simulations
Simulink.SimulationInput objects to run multiple
simulations using the parsim function and the
batchsim functions, or the Multiple Simulations panel
in Simulink®For workflows that involve multiple parallel simulations and logging of
large data, you can use Simulink.SimulationInput
objects to specify the inputs for the parsim or
batchsim function, or run the simulations with the
Multiple Simulations panel in the Simulink Editor.
You can use Simulink.SimulationInput objects to
specify simulation configurations and run multiple simulations with those
changes. With a Parallel Computing Toolbox™ license, you can use the parsim function to run the
simulations in parallel. The function distributes multiple simulations to
parallel workers to speed up overall simulation time. Using the parsim function with
Parallel Computing Toolbox allows you to automate the creation of parallel pools,
identifies file dependencies, and manages build artifacts for accelerator
and rapid accelerator simulations. The parsim function
runs simulations in serial if a Parallel Computing Toolbox license is not available.
You can use the batchsim function with Parallel Computing Toolbox and MATLAB®
Parallel Server™ licenses. When you use the batchsim
function, simulations are offloaded onto a compute cluster. You can open a
separate MATLAB session to access the job and the results.
To get started, see Running Multiple Simulations in Simulink and Run Parallel Simulations for a Thermal Model of a House Using parsim.
To take a self-paced, interactive course on running multiple simulations in parallel, see Run Multiple Simulations in Parallel.
Objects
Functions
Tools
| Multiple Simulations | Run multiple simulations from the Simulink Editor (Since R2021b) |
| Simulation Manager | Monitor multiple simulations and visualize the simulation data |
Topics
- Running Multiple Simulations in Simulink
Run multiple simulations from the
parsimandbatchsimcommands, and the Multiple Simulations panel in Simulink Editor. - Run Parallel Simulations for a Thermal Model of a House Using parsim
Use a
Simulink.SimulationInputobject to run multiple parallel simulations command line workflow. - Run Parallel Simulations
Programmatically run model simulations in parallel.
- Configure and Run Simulations with Multiple Simulations Panel
Learn about the Multiple Simulations panel in the Simulink Editor.
- Comparison Between Multiple Simulation Workflows
Understand the similarities and differences between
parsim,parsimwithRunInBackground, andbatchsim. - Analyze Results Using Simulation Manager
Use the Simulation Manager to visualize simulation data, analyze simulation results and trends.
- Resolve Setup Issues on Parallel Workers When Running Parallel Simulations with parsim
Troubleshoot and debug setup issues on parallel workers using
Diary, when running parallel simulations withparsim.





