Programmatic setting of Argument attribute for parameter in Simulink model workspace

656 views Asked by At

I am using some Matlab m scripts to batch-process a set of Simulink models to produce Autosar software components using Embedded-Coder. I want some of the components to use Port-Parameters defined in a separate Parameter Component rather than Shared-Parameters within the component.

Using the Matlab help files I have managed to script most of the required steps but there is one step that I am stuck at. For the parameters that I want to convert to Port-Parameters, I need to go into the Model Workspace and set the "Argument" attribute for each parameter. I can do this in the GUI, but I have not managed to find out how to script this step.

Can anyone tell me how to set the Argument attribute of a parameter in the Model Workspace from an m script?

1

There are 1 answers

0
John Phoenix On

A colleague found the answer to this question for me.

To set the Argument attribute for parameters "Param1", "Param2" and "Param3" in your model:

set_param(model,'ParameterArgumentNames','Param1,Param2,Param3');