How to Speed Up a Slow MATLAB Simulink Simulation: Common Causes, Performance Bottlenecks, and Effective Optimization Techniques
John Michell answered .
2026-06-17
1. Quick Wins (Do These First)
- Close all Scopes and unnecessary visualizations Scopes, Displays, and logging blocks eat up a ton of time. Close them or reduce the number of data points they show.
- Disable unnecessary diagnostics Go to Configuration Parameters → Diagnostics and turn off things like:
- Division by singular matrix
- Inf/NaN checking
- Simulation range checking
- Array bounds exceeded
These are great for debugging but kill performance once the model is stable.
2. Switch Simulation Mode (Biggest Speed Boost)
This is often the single biggest improvement:
| Mode | Speed Gain | When to Use | Notes |
|-----------------------|---------------------|------------------------------------------|-------|
| Normal | Baseline | Debugging, frequent changes | Slowest |
| Accelerator | 2–5x faster | Most cases | Good balance |
| Rapid Accelerator | Often 5–10x+ faster | Batch runs, Monte Carlo, final testing | Fastest, but less flexible |
How to change it: Top toolbar → Simulation Mode → choose Accelerator or Rapid Accelerator.
Pro tip: Use Rapid Accelerator + Fast Restart for repeated runs with parameter changes.
3. Use the Performance Advisor (MathWorks’ Built-in Helper)
This is gold:
1. Go to Debug tab → Performance Advisor.
2. Run it it analyzes your model and gives specific recommendations on solver, block settings, optimizations, etc.
3. Apply the suggestions it gives. Many people see 3–10x improvement from this alone.
4. Solver & Configuration Tweaks
- Use a variable-step solver (like `ode45` or `ode23tb`) unless you need fixed-step.
- Increase the Max step size (if your system allows it) smaller steps = slower simulation.
- Enable Block reduction and other optimizations in Configuration Parameters → Optimization.
- For models with MATLAB Function blocks: Replace Interpreted MATLAB Function with regular MATLAB Function blocks (huge difference).
- Use Simulink Cache and Model Referencing for large models.
5. Model-Level Optimizations
- Replace slow blocks (e.g., continuous integrators where possible, avoid algebraic loops).
- Use discrete solvers instead of continuous when you can.
- For power electronics / Simscape models: Disable dead-time simulation, use average-value models instead of detailed switching models during early design.
- Avoid unnecessary continuous signals.
6. Hardware & Environment
- Close other applications.
- Use a machine with more RAM and a fast CPU (multi-core helps a lot with parallel simulations via `parsim`).
- Turn on Fast Restart (great for tuning parameters without recompiling).
7. Advanced Options (When You Really Need Speed)
- Parallel simulation with `parsim` for running multiple scenarios.
- Generate production code or use SIL/PIL if applicable.
- Export the model to a standalone executable.
---
Recommended Order to Try:
1. Close scopes + disable heavy diagnostics
2. Switch to Accelerator mode
3. Run Performance Advisor
4. Tune solver + enable optimizations
5. Go Rapid Accelerator + Fast Restart
Most people get dramatic improvements (sometimes 5–20x) just from steps 1–3.