| 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… |
|---|
Changing the structure of your model causes the Rapid Accelerator mode to regenerate the standalone executable, and for the Accelerator mode to regenerate the target code and update (overwrite) the existing MEX-file.
Examples of model structure changes that result in a rebuild include:
Changing the solver type, for example from Variable-step to Fixed-step
Adding or deleting blocks or connections between blocks
Changing the values of nontunable block parameters, for example, the Seed parameter of the Random Number block
Changing the number of inputs or outputs of blocks, even if the connectivity is vectorized
Changing the number of states in the model
Selecting a different function in the Trigonometric Function block
Changing signs used in a Sum block
Adding a Target Language Compiler (TLC) file to inline an S-function
Changing the sim command output argument when using the Rapid Accelerator mode
Changing solver parameters such as stop time or rel tol when using the Rapid Accelerator mode
The Accelerator and Rapid Accelerator modes use a checksum to determine if the model has changed, indicating that the code should be regenerated. The checksum is an array of four integers computed using an MD5 checksum algorithm based on attributes of the model and the blocks it contains.
Use the Simulink.BlockDiagram.getChecksum command to obtain the checksum for your model. For example:
cs1 = Simulink.BlockDiagram.getChecksum('myModel');
Obtain a second checksum after you have altered your model. The code regenerates if the new checksum does not match the previous checksum. You can use the information in the checksum to determine why the simulation target rebuilt. For a detailed explanation of this procedure, see the demo model slAccelDemoWhyRebuild.
In terms of model rebuilds, Block Diagram and Run-time parameters are handled differently than other parameters in rapid accelerator mode.
Some Block Diagram parameters can be changed during simulation without causing a rebuild. These Block Diagram parameters include the following:
| BLOCK DIAGRAM PARAMETERS THAT DO NOT REQUIRE RAPID ACCELERATOR REBUILD | |
|---|---|
| Solver Parameters | Loading and Logging Parameters |
| AbsTol | Decimation |
| ConsecutiveZCsStepRelTol | FinalStateName |
| ExtrapolationOrder | InitialState |
| InitialStep | LimitDataPoints |
| MaxConsecutiveMinStep | LoadExternalInput |
| MaxConsecutiveZCs | LoadInitialState |
| MaxNumMinSteps | MaxDataPoints |
| MaxOrder | OutputOption |
| MaxStep | OutputSaveName |
| MinStep | SaveFinalState |
| NumberNwtonIterations | SaveFormat |
| OutputTimes | SaveOutput |
| Refine | SaveState |
| RelTol | SaveTime |
| SolverName | SignalLogging |
| StartTime | SignalLoggingName |
| StopTime | StateSaveName |
| ZCDetectionTol | TimeSaveName |
Run-time parameters are collected within an rtp structure either by user specification via a simset option or through automatic collection during the compile phase. Changes to the Run-time parameters are supported if they are passed directly to sim. However, if they are passed graphically via the block diagram or programmatically via the set_param command, then a rebuild may be necessary. All other parameter changes may necessitate a rebuild.
| Parameter Changes: | Passed Directly to sim command | Passed Graphically via Block Diagram or via set_param command |
|---|---|---|
| Run-time | Rebuild Not Required | Rebuild May Be Required |
| Block Diagram (Solver and Logging Parameters) | Rebuild Not Required | Rebuild Not Required |
| Other | Rebuild May Be Required | Rebuild May Be Required |
![]() | How the Acceleration Modes Work | Choosing a Simulation Mode | ![]() |

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 |