How can I use nested structures in my generated code?

조회 수: 5 (최근 30일)
How can I use nested structures in my generated code?
I would like to use a few nested structures to capture most of the data used by my model, but Embedded Coder is splitting it into multiple separate variables.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2024년 1월 18일
편집: MathWorks Support Team 2024년 2월 29일
The attached files provide two examples of using nested structures in Embedded Coder generated code. Open the "struct_csc_param_init.m" script to see how the nested structures are set up and run it to observe the resulting generated code.
The first example produces a nested structure in the generated code from separate variables in the Base Workspace using the Struct Custom Storage Class.
Here is a link to the MATLAB Documentation describing the "Struct custom storage class"
The second example produces a nested structure in the generated code based on a nested structure in the Base Workspace.
Both example use the "Simulink.Parameter" object as a way to control the format of the generated code.
Please refer to the MATLAB documentation that describes the "Simulink.Parameter" object. To access the release-specific documentation, run the following command in the MATLAB R2018b command window.
web(fullfile(docroot, 'search.html?submitsearch=&qdoc=Simulink.Parameter'))
Please follow the below link to search for the required information regarding the current release:

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by