Main Content

Define and Use Structure Parameters

Defining Structure Parameters

To define structure parameters in MATLAB Function blocks, follow these steps:

  1. Define and initialize a structure variable

    A common method is to create a structure in the base workspace.

  2. Use the Symbols pane and the Property Inspector to add data in the MATLAB Function block with the following properties:

    PropertyWhat to Specify
    NameEnter same name as the structure variable you defined in the base workspace
    ScopeSelect Parameter
    TunableLeave checked if you want to change (tune) the value of the parameter during simulation; otherwise, clear to make the parameter nontunable and preserve the initial value during simulation
    TypeSelect Inherit: Same as Simulink

FIMATH Properties of Nontunable Structure Parameters

FIMATH properties for nontunable structure parameters containing fixed-point values are based on the initial values of the structure. They do not come from the FIMATH properties specified for fixed-point input signals to the parent MATLAB Function block. (These FIMATH properties appear in the properties dialog box for MATLAB Function blocks.)

See Also

Related Topics