Main Content

Support Limitations for MATLAB for Code Generation

Unsupported MATLAB for Code Generation Features

Simulink® Design Verifier™ does not support the following features of the MATLAB Function block in the Simulink software and MATLAB® functions in the Stateflow® software. Avoid using these unsupported features in models that you analyze with Simulink Design Verifier.

Not SupportedDescription

Characters

The software does not support characters, which MATLAB for code generation allows.

C functions

The software does not support calls to external C functions, which MATLAB for code generation allows.

Extrinsic functions

The software supports extrinsic functions only when they do not affect the output of a MATLAB function.

Support Limitations for MATLAB for Code Generation Library Functions

Simulink Design Verifier provides various levels of support for MATLAB for code generation library functions. The software either fully or partially supports particular functions. It does not support other functions.

If your model contains unsupported functions, you can turn on automatic stubbing, which considers the interface of the unsupported functions, but not their behavior. However, if any of the unsupported functions affect the simulation outcome, the analysis might achieve only partial results. For details about automatic stubbing, see Handle Incompatibilities with Automatic Stubbing.

To achieve 100% coverage, avoid using unsupported MATLAB library functions in models that you analyze.

The following table lists Simulink Design Verifier support for categories of library functions in code generation from MATLAB:

  • Software supports functions in that category, indicated by a dash ().

  • Software does not support functions in that category.

  • Software supports the function in that category with limitations as specified.

For the complete listing of available functions, see Functions and Objects Supported for C/C++ Code Generation.

Function CategorySupport Notes
Aerospace Toolbox functionsNot supported.
Arithmetic operator functionsSupported with the following limitations:
 mldivide (\)Supported.
 mpower (^)Supports only integer exponents. Otherwise partially supported.
 mrdivide (/)Supported.
 power (.^)Supports integer exponents. Float exponents partially supported.
Bit-wise operation functions
Casting functionsSupported with the following limitations:
 charNot supported.
 typecastNot supported.
Communications Toolbox™ functionsNot supported.
Complex number functionsPartially supported.
Computer Vision Toolbox™ functionsNot supported.
Data type functions
Derivative and Integral functionsNot supported.
Discrete math functions
Error handling functionsSupported with the following limitations:
 assertSupported, but does not behave like a Proof Objective block.
Exponential functionsSupported.
Filtering and convolution functionsSupported with the following limitations:
 detrendSupported if argument is a scalar. Otherwise, partially supported.
Fixed-Point Designer™ functionsSupported.
Histogram functionsNot supported.
Image Processing Toolbox™ functionsNot supported.
Input and output functions
Interpolation and computation geometrySupported with the following limitations:
 cart2polPartially supported.
 cart2sphPartially supported.
 pol2cartPartially supported.
 sph2cartPartially supported.
Linear algebraNot supported.
Logical operator functions
MATLAB Compiler™ functionsNot supported.
Matrix and array functionsSupported with the following limitations:
 anglePartially supported.
 condPartially supported.
 detSupported.
 eigPartially supported.
 invSupported.
 invhilbNot supported.
 logspacePartially supported.
 luSupported.
 normSupported when invoked using the syntax norm(A,p) where p is either 1 or inf. Otherwise partially supported.
 normestPartially supported.
 pinvPartially supported.
 planerotPartially supported.
 qrPartially supported.
 rankPartially supported.
 rcondSupported.
 subspacePartially supported.
Nested functionsSupported.
Nonlinear numerical methodsNot supported.
Polynomial functionsNot supported.
Relational operations functions
Rounding and remainder functions
Policy blockNot supported.
RL Agent blockNot supported.
Set functions
Signal Processing functions in MATLABNot supported.
Signal Processing Toolbox™ functionsNot supported.
Special valuesSupported with the following limitations:
 randPartially supported.
 randnPartially supported.
Specialized mathNot supported.
Statistical functions
String functionsSupported with the following limitations:
 charNot supported.
 ischarNot supported.
Trigonometric functionsNot supported.