フィルターのクリア

Why array of structures is not supported in simulink function argument data type definition?

3 ビュー (過去 30 日間)
  • When I created a array of structure included ARXML and import to Matlab, then the error comes our like below: The argument 'xxx' of operation 'AAA' has data type 'IDT_Array_xxxx' which is an array of a record type. This data type is not supported.
  • To specify the array of structure data type, it's a array consistents several structure as its base data type element.
  • And after I check the help document of 'Simulink function', there is not array included in data type shown as below:
  • So I am wondering why the array of structure is support in sender/receiver port, but not support in client/server port which is implemented as simulink function?

回答 (1 件)

Ayush
Ayush 2024 年 1 月 2 日
The reason why the array of structure is support in sender/receiver port, but not support in client/server port which is implemented as simulink function is:
  • When using client/server ports with Simulink functions, the data types for the inputs and outputs must be compatible with the code generation requirements of Simulink. Simulink functions are designed with the intention of being able to generate standalone C code that can be deployed on embedded systems. Arrays of structures are not supported as inputs or outputs for Simulink functions because the C code generated from such constructs would be complex and potentially non-portable.
  • The underlying reason for this limitation is that the memory layout and handling of arrays of structures can be quite complex, especially when considering dynamic memory allocation, memory alignment, and other low-level details that are crucial for embedded systems programming.
Thanks,
Ayush
  2 件のコメント
madhan ravi
madhan ravi 2024 年 1 月 2 日
編集済み: madhan ravi 2024 年 1 月 2 日
+1 , very informative. Just curious, why don’t you use MathWorks Staff Account to answer directly in the forum :)?
Hongliang Ran
Hongliang Ran 2024 年 1 月 3 日
Thanks for the answer, BTW this answer is kinda official answer? XD

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

カテゴリ

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

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by