matlab官方介绍页:
https://ww2.mathworks.cn/help/simulink/ug/code-generation-readiness-tool.html
coder.screener
确定函数是否适合代码生成
https://ww2.mathworks.cn/help/simulink/slref/coder.screener.html
C/C++ 代码生成支持的函数和对象:
https://ww2.mathworks.cn/help/simulink/ug/functions-and-objects-supported-for-cc-code-generation.html
数值积分函数integral不支持生成
trapz函数支持生成
但是有限制:
用法说明和限制:
- 如果提供 dim,则它必须为常量。
- 请参阅Variable-Sizing Restrictions for Code Generation of Toolbox Functions (MATLAB Coder)。