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. For other methods, see Structure Parameters.

  2. In the Ports and Data Manager, 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 non-tunable and preserve the initial value during simulation
    TypeSelect Inherit: Same as Simulink

  3. Click Apply.

FIMATH Properties of Non-Tunable Structure Parameters

FIMATH properties for non-tunable 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.)

Was this topic helpful?