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.

Handle classes

The software does not support handle classes in the MATLAB Function block. The software does support value classes.

Sqrt function

The software does not support sqrt function in the MATLAB Function block.

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 (\)Supports only scalar arguments.
 mpower (^)Supports only integer exponents.
 mrdivide (/)Supports only scalar arguments.
 power (.^)Supports only integer exponents.
Bit-wise operation functions
Casting functionsSupported with the following limitations:
 charNot supported.
 typecastNot supported.
Communications Toolbox™ functionsNot supported.
Complex number functionsSupported.
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:
 detrendNot 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:
 cart2polNot supported.
 cart2sphNot supported.
 pol2cartNot supported.
 sph2cartNot supported.
Linear algebraNot supported.
Logical operator functions
MATLAB Compiler™ functionsNot supported.
Matrix and array functionsSupported with the following limitations:
 angleNot supported.
 condNot supported.
 detNot supported.
 eigNot supported.
 invNot supported.
 invhilbNot supported.
 logspaceNot supported.
 luNot supported.
 norm

Supported only when invoked using the syntax

norm(A,p)

where p is either 1 or inf.

 normestNot supported.
 pinvNot supported.
 planerotNot supported.
 qrNot supported.
 rankNot supported.
 rcondNot supported.
 subspaceNot supported.
Nested functionsSupported.
Nonlinear numerical methodsNot supported.
Polynomial functionsNot supported.
Relational operations functions
Rounding and remainder functions
Set functions
Signal Processing functions in MATLABNot supported.
Signal Processing Toolbox™ functionsNot supported.
Special valuesSupported with the following limitations:
 randNot supported.
 randnNot supported.
Specialized mathNot supported.
Statistical functions
String functionsSupported with the following limitations:
 charNot supported.
 ischarNot supported.
Trigonometric functionsNot supported.