Does Embedded Coder support instance-specific parameters for top model when generating C++ code?
9 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2019 年 5 月 10 日
編集済み: MathWorks Support Team
2023 年 7 月 26 日
I am generating code using the C++ class interface (CodeInterfacePackaging="C++ Class") and I want my parameters to be instance-specific (ie each object can have it's own values). The parameters are showing up in the model class, but they have the "static" keyword and therefore are shared between all objects of the class. How can I make my parameters instance-specific?
採用された回答
MathWorks Support Team
2023 年 7 月 26 日
編集済み: MathWorks Support Team
2023 年 7 月 26 日
Support for instance-specific parameters was added in R2021a (see this release note ). You can make them instance-specific by:
1) Putting the parameter in the Model Workspace and marking it as Argument. This is referred to as a "Model Argument", and is explained here: https://www.mathworks.com/help/simulink/ug/parameterize-referenced-models.html#f4-141806
2) In Code Mappings, set the "Data Visibility" for "Model parameter arguments" to "private":
1 件のコメント
Elizabeth Reese
2020 年 7 月 20 日
As of MATLAB R2020a and MATLAB 2020b Prerelease, this functionality is still unavailable. The development team is actively investigating the feature, so please continue to check back for updates as new releases are published.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Deployment, Integration, and Supported Hardware についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!