Control Run-Time Checks - MATLAB & Simulink (original) (raw)

Main Content

Types of Run-Time Checks

When you generate MEX code from your MATLABĀ® function, the generated code includes the following run-time checks and external calls to MATLAB functions by default:

When to Disable Run-Time Checks

Generally, generating code with run-time checks enabled results in more generated code and slower MEX function execution than generating code with the checks disabled. Similarly, extrinsic calls are time consuming and increase memory usage and execution time. Disabling run-time checks and extrinsic calls usually results in streamlined generated code and faster MEX function execution. The following table lists issues to consider when disabling run-time checks and extrinsic calls.

Consider disabling... Only if...
Memory integrity checks You have already verified that 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.
Extrinsic calls You are using extrinsic calls only for functions that do not affect application results.

How to Disable Run-Time Checks

To explicitly disable run-time checks in the generated MEX function, use one of these approaches:

See Also

MATLAB Coder | codegen | coder.extrinsic

Topics