How do I convert a .m with unsupported in-built MATLAB functions to C++

11 ビュー (過去 30 日間)
Crownie Eme
Crownie Eme 2020 年 9 月 4 日
回答済み: Harsh 2025 年 1 月 31 日 10:40
Hi everyone.
I'm currently trying to convert a MATLAB script to C++ but MATLAB Coder gives some errors saying some functions are unsupported in the code conversion.
Below are the unsupported functions
fullfile is not supported for code generation
com.mathworks.toolbox.coder.screener.ScreenerError@ca978627
imageSet is not supported for code generation
com.mathworks.toolbox.coder.screener.ScreenerError@36c733bd
partition is not supported for code generation
com.mathworks.toolbox.coder.screener.ScreenerError@b1e1e753
bagOfFeatures is not supported for code generation
com.mathworks.toolbox.coder.screener.ScreenerError@3e7efb02
encode is not supported for code generation
com.mathworks.toolbox.coder.screener.ScreenerError@31cdf3a9
bar is not supported for code generation
com.mathworks.toolbox.coder.screener.ScreenerError@83fd9938

回答 (1 件)

Harsh
Harsh 2025 年 1 月 31 日 10:40
Hi Crownie,
For the functions which are not supported for code generation in MATLAB, please follow the below steps:
  • If you are generating MEX files, you can declare the unsupported function as extrinsic using coder.extrinsic. This tells the code generator to bypass code generation for that function and instead use the MATLAB engine to execute it. For more information regarding “coder.extrinsic” please refer to the following documentation – https://www.mathworks.com/help/coder/ref/coder.extrinsic.html
  • For standalone code generation, you can manually implement the unsupported function using MATLAB code that is supported for code generation.

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by