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 Supported | Description |
---|---|
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 Category | Support Notes | |
---|---|---|
Aerospace Toolbox functions | Not supported. | |
Arithmetic operator functions | Supported 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 functions | Supported with the following limitations: | |
char | Not supported. | |
typecast | Not supported. | |
Communications Toolbox™ functions | Not supported. | |
Complex number functions | Partially supported. | |
Computer Vision Toolbox™ functions | Not supported. | |
Data type functions | — | |
Derivative and Integral functions | Not supported. | |
Discrete math functions | — | |
Error handling functions | Supported with the following limitations: | |
assert | Supported, but does not behave like a Proof Objective block. | |
Exponential functions | Supported. | |
Filtering and convolution functions | Supported with the following limitations: | |
detrend | Supported if argument is a scalar. Otherwise, partially supported. | |
Fixed-Point Designer™ functions | Supported. | |
Histogram functions | Not supported. | |
Image Processing Toolbox™ functions | Not supported. | |
Input and output functions | — | |
Interpolation and computation geometry | Supported with the following limitations: | |
cart2pol | Partially supported. | |
cart2sph | Partially supported. | |
pol2cart | Partially supported. | |
sph2cart | Partially supported. | |
Linear algebra | Not supported. | |
Logical operator functions | — | |
MATLAB Compiler™ functions | Not supported. | |
Matrix and array functions | Supported with the following limitations: | |
angle | Partially supported. | |
cond | Partially supported. | |
det | Supported. | |
eig | Partially supported. | |
inv | Supported. | |
invhilb | Not supported. | |
logspace | Partially supported. | |
lu | Supported. | |
norm | Supported when invoked using the syntax
norm(A,p) where p is
either 1 or inf . Otherwise
partially supported. | |
normest | Partially supported. | |
pinv | Partially supported. | |
planerot | Partially supported. | |
qr | Partially supported. | |
rank | Partially supported. | |
rcond | Supported. | |
subspace | Partially supported. | |
Nested functions | Supported. | |
Nonlinear numerical methods | Not supported. | |
Polynomial functions | Not supported. | |
Relational operations functions | — | |
Rounding and remainder functions | — | |
Policy block | Not supported. | |
RL Agent block | Not supported. | |
Set functions | — | |
Signal Processing functions in MATLAB | Not supported. | |
Signal Processing Toolbox™ functions | Not supported. | |
Special values | Supported with the following limitations: | |
rand | Partially supported. | |
randn | Partially supported. | |
Specialized math | Not supported. | |
Statistical functions | — | |
String functions | Supported with the following limitations: | |
char | Not supported. | |
ischar | Not supported. | |
Trigonometric functions | Not supported. |