How do I specify the struct type name that Simulink code generator creates for a workspace structure

13 ビュー (過去 30 日間)
I have a Simulink model that references a workspace structure. I generate code for that model. The code generator creates data types (typedef struct) for the structure and then declares variables of those types. The variable names match the workspace variable names, but the struct type definitions have seemingly randomly generated names (struct_a34AMM302nakjd). Is there a way to designate the name of these struct type definitions?

回答 (1 件)

Kaustubha Govind
Kaustubha Govind 2012 年 3 月 7 日
I think you need to use non-virtual buses to have the generated code use the corresponding Simulink.Bus name as the name of the struct type.
  2 件のコメント
Mark
Mark 2012 年 3 月 7 日
I agree that a non-virtual bus would get named appropriately by the code generator. But is it possible to reference workspace variables through a non-virtual bus? Right now I am setting, for example, the parameter of a gain block based on a workspace struct variable.
Luis Ruiz
Luis Ruiz 2019 年 2 月 4 日
編集済み: Luis Ruiz 2019 年 2 月 4 日
Is there any other way to achieve this?

サインインしてコメントする。

カテゴリ

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