Hi,
To change the names of the external inputs (ExtU) and outputs (ExtY) in the generated code in MATLAB R2023b, you can use the Code Mappings editor or the command-line API to configure the names of the data elements. Here’s how you can do this using the Code Mappings Editor:
1. Open the Model: Open your Simulink model.
2. Open Code Mappings Editor:
- Go to the Apps tab in the Simulink model window.
- Select Embedded Coder.
- In the C Code tab, click on Code Interface > Default Code Mappings.
3. Configure External Inputs and Outputs:
- In the Code Mappings editor, go to the Inports/Outports tab.
- For each input port, you can set the Storage Class and Identifier in the Code section of Property Inspector. The Identifier is the name that will be used in the generated code.
- Similarly, for each output port, set the Storage Class and Identifier.
NOTE:
- Storage Class: The storage class parameter should be set to 'ExportedGlobal' or another appropriate storage class('Model Default') to ensure that the identifier is used in the generated code.
- Identifier: The Identifier parameter specifies the name that will appear in the generated code.
If you would like to control the names of the struct type then you can refer to the following documentation link: