フィルターのクリア

matlab structure in generated code for variant control

4 ビュー (過去 30 日間)
Jake Gareau
Jake Gareau 2024 年 2 月 21 日
回答済み: Aman 2024 年 3 月 15 日
is there anyway to control how a matlab structure is generated with embedded coder? for example setting the storage class or name? currently the structure has a random name and only appears if I have parameters set to tunable, it is also nested inside another data structure.
I want to use the structure to control a variant subsystem. Trying to use a simulink.parameter with a bus data type does not work for embedded coder codegen (startup activation).

回答 (1 件)

Aman
Aman 2024 年 3 月 15 日
Hi Jake,
From the information provided, I understand that you want to have control over the name and the storage class in the generated code.
In order to give a custom name to the structure in the generated code, you can use the "coder.cstructname" function, which names the C structure type in the generated code. It can also be used to give a name to the nested structure that is your desired requirement. You can refer to the following documentation link, which discusses the same.
In order to control the storage class in the generated code, you can utilize the "CoderInfo" property of the "Simulink.Parameter" object and the "CustomStorageClass" property of the "CoderInfo" to set the custom storage class. You can refer to the following documentation to learn more about it.
I hope this will help you proceed with your workflow.

カテゴリ

Help Center および File ExchangeDeployment, Integration, and Supported Hardware についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by