MATLAB coder gives multiple errors for hierarchical code

2 ビュー (過去 30 日間)
Devangsingh Sankhala
Devangsingh Sankhala 2020 年 9 月 4 日
編集済み: Raghu Boggavarapu 2020 年 9 月 7 日
I am trying to convert a regression model I generated from regression learner to C for an iOS implementation. The testbench of the function is predictX_test.m and the function to be translated is predictX010.m. predictX010.m relies on mypadcat and mystrsplit to do data pre-processing operations. The code works perfectly in MATLAB but the MATLAB coder doesn't like dynamic memory changes. The errors are shown in the image below, and they occur even in the presence of coder.varsize() calls. What can I do to make them go away?

採用された回答

Raghu Boggavarapu
Raghu Boggavarapu 2020 年 9 月 7 日
編集済み: Raghu Boggavarapu 2020 年 9 月 7 日
Use coder.varsize with explicit size specification where applicable. coder.varsize cannot be used on internal function input/output arguments and some modifications need to be done to the code to enable code generation. Also explictly use real(..) when complexity of the double expression is not inferrred correctly.
Please find the attached source for modifications.

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by