Why aren't some functions supported for code generation with MATLAB Coder?
8 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2025 年 9 月 30 日
回答済み: MathWorks Support Team
2026 年 1 月 22 日 22:13
I'm trying to use the MATLAB Coder to generate C code from my MATLAB scripts and am seeing an error of the form
Function "<name>" is not supported for code generation
regarding certain built-in MATLAB functions. What does this error mean, and why isn't code generation supported for these functions?
採用された回答
MathWorks Support Team
2025 年 9 月 30 日
Some MATLAB functions are not supported for code generation. If you have would like to know whether a function you are using is supported for code generation, please check this complete list of the Functions and Objects Supported for C/C++ Code Generation in the latest release.
Generally speaking, there is no common component of the unsupported functions that causes them to be unsupported by MATLAB Coder. If you are interested in enabling code generation for a specific built-in function, you can use the web form to Request Code Generation Support for MATLAB Functions.
The following workarounds can be used when generating code for MATLAB code that uses unsupported functions:
1. The
function will allow you to call an external C or C++ function. This option will require you to either write your own C/C++ code or find an existing C/C++ function that accomplishes the task of the unsupported function.
2. There is also a coder.extrinsic function in MATLAB that allows you to declare the unsupported function as 'extrinsic'. With this option, the code generator produces code for the call to the extrinsic function but does not produce the function's internal code. Therefore, the 'coder.extrinsic' workaround requires that you have the MATLAB Runtime environment on the computer where you are planning to run the generated code.
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!