Alternatives for functions not supported for code generation
8 ビュー (過去 30 日間)
古いコメントを表示
Deepa Maheshvare
2023 年 10 月 3 日
コメント済み: Walter Roberson
2023 年 10 月 4 日
Hi All,
I am using MATLAB coder to generate C code from MATLAB code files.
Some functions are not supported for code generations
e.g.
fullfile
dir
pwd
cell2mat
strcat
successors
Suggestions on alternate options for the above-mentioned functions would be of great help.
採用された回答
Walter Roberson
2023 年 10 月 4 日
The following are supported for code generation in R2023b:
- fullfile https://www.mathworks.com/help/matlab/ref/fullfile.html#refsect-extended-capabilities (as of R2023b)
- pwd https://www.mathworks.com/help/matlab/ref/pwd.html#refsect-extended-capabilities (as of R2023a)
- cell2mat https://www.mathworks.com/help/matlab/ref/cell2mat.html#refsect-extended-capabilities (as of R2023b)
- strcat https://www.mathworks.com/help/matlab/ref/strcat.html#refsect-extended-capabilities (as of R2023a)
Still not supported:
- dir
- incidence
dir() is a tricky one, as MATLAB Coder is designed to be able to target systems that do not have file systems.
incidence is something that could be programmed yourself with (for example) accumarray (if a "full" matrix is acceptable) or using sparse if you need a sparse version.
I would suggest to you that it would be easier if you were to upgrade to R2023b. Otherwise you are going to need to call coder.ceval
4 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!