How can I change tunable parameters in generated C++ class from private to public?

8 ビュー (過去 30 日間)
Xianyue Li
Xianyue Li 2016 年 1 月 19 日
編集済み: C.J. Harris 2016 年 1 月 19 日
Hello,
I have a simulink model with some tunable parameters. If these parameters are configured as "SimulinkGlobal", in the generated C++ code they will be defined in a structure and this structure is declared as a private element in the model class. I would like to access these parameters from another file. But if these parameters are configured as "ExportedGlobal", each of them will be defined as an extern variable in the generated code which is not what I want. Is it possible to gather all tunable parameters in one structure and make this structure a public element in the model class?
Thank you in advance

採用された回答

C.J. Harris
C.J. Harris 2016 年 1 月 19 日
編集済み: C.J. Harris 2016 年 1 月 19 日
If you set parameter member visibility option to 'public' this will move the tunable parameters structure from private to public:
set_param(h, 'ParameterMemberVisibility', 'public');
Where h is the handle to your Simulink model.

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by