| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
| On this page… |
|---|
Compiler optimizations are off by default. This results in faster build times. To optimize acceleration of your model, set the compiler optimization level from the Optimization pane in the Configuration Parameters dialog box.

Select Optimizations on (faster runs) when you want to create optimized code. Code generation takes longer with this option, but the model runs faster.
Select Verbose accelerator builds to display progress information using code generation, and to see the compiler options in use.
To accelerate a model, first open it, and then from the Simulation menu, select either Accelerator or Rapid Accelerator. Then start the simulation.
The following example shows how to accelerate the already opened f14 model using the Accelerator mode:
From the Simulation menu, select Accelerator.
Alternatively, you can select Accelerator from the model editor's toolbar.

From the Simulation menu, select Start.
The Accelerator and Rapid Accelerator modes first check to see if code was previously compiled for your model. If code was created previously, the Accelerator or Rapid Accelerator modes run the model. If code was not previously built, they first generate and compile the C code, and then run the model.
For reasons why these modes rebuild your model, see Code Regeneration in Accelerated Models.
The Accelerator mode places the generated code in a subdirectory called modelname_accel_rtw (for example, f14_accel_rtw), and places a compiled MEX-file in the current working directory.
The Rapid Accelerator mode places the generated code in a subdirectory called modelname_raccel_rtw (for example, f14_raccel_rtw).
Note The warnings that blocks generate during simulation (such as divide-by-zero and integer overflow) are not displayed when your model runs in Accelerator or Rapid Accelerator modes. |
A feature of the Accelerator and Rapid Accelerator modes is that simple adjustments (such as changing the value of a Gain or Constant block) can be made to the model while the simulation is still running. More complex changes (for example, changing from a sin to tan function) are not allowed during run time.
The Simulink software issues a warning if you attempt to make a change that is not permitted. The absence of a warning indicates that the change was accepted. The warning does not stop the current simulation, and the simulation continues with the previous values. If you wish to alter the model in ways that are not permitted during run time, you must first stop the simulation, make the change, and then restart the simulation.
In general, simple model changes are more likely to result in code regeneration when in Rapid Accelerator mode than when in Accelerator mode. For instance, changing the stop time in Rapid Accelerator mode causes code to regenerate, but does not cause Accelerator mode to regenerate code.
![]() | Designing Your Model for Effective Acceleration | Interacting with the Acceleration Modes Programmatically | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |