|On this page…|
In simulation, the code generated for your MATLAB Function block includes the following run-time checks:
Memory integrity checks
These checks detect violations of memory integrity in code generated for MATLAB Function blocks and stop execution with a diagnostic message.
Responsiveness checks in code generated for MATLAB Function blocks
These checks enable periodic checks for Ctrl+C breaks in the generated code. Enabling responsiveness checks also enables graphics refreshing.
Generally, generating code with run-time checks enabled results in more lines of generated code and slower simulation than generating code with the checks disabled. Disabling run-time checks usually results in streamlined generated code and faster simulation, with these caveats:
|Consider disabling:||Only if:|
|Memory integrity checks||You are sure that your code is safe and that all array bounds and dimension checking is unnecessary.|
|Responsiveness checks||You are sure that you will not need to stop execution of your application using Ctrl+C.|
MATLAB Function blocks enable run-time checks by default, but you can disable them explicitly for all MATLAB Function blocks in your Simulink® model. Follow these steps:
Open your MATLAB Function block.
In the MATLAB Function Block Editor, select Simulation Target.
The Configuration Parameters dialog box opens with Simulation Target selected.
Clear the Ensure memory integrity or Ensure responsiveness check boxes, as applicable, and click Apply.