Main Content

Simulink Functions and Variables

Create table that displays workspace variables and MATLAB functions used by reported blocks in Simulink models

Description

This component creates a table that displays workspace variables and MATLAB® functions used by blocks in a Simulink® model. The Model Loop component specifies the current model and systems in which the blocks appear. For example, suppose a Simulink Gain block has a string cos(x) instead of a number. The Simulink software looks for a variable x in the workspace and uses the cos function.

Functions

  • Include table of functions: Includes a table of Simulink functions in the generated report.

  • Table Title: Specifies a title for the table in the generated report:

    • Automatic: Generates a title automatically from the parameter.

    • Custom: Specifies a custom title.

  • Parent block: Includes a column in the table that includes the name of the block, which contains the reported variable.

  • Calling string: Includes the MATLAB code that calls the reported variable.

  • Include fixed-point functions (sfix, ufix, ...): Includes Fixed-Point Designer™ functions in the report.

Variables

  • Include table of variables: Includes a table of Simulink variables in the generated report.

  • Table title: Specifies the table title in the generated report.

    • Automatic: Use the automatically generated title.

    • Custom: Specify a custom title.

  • Include Workspace I/O parameters: Reports on variables that contain parameters with time vectors and state matrices. Set these parameters in the Workspace I/O pane in the Simulation Parameters dialog box in a Simulink model.

    In the following table, if any of the entries in the first column are on, the component looks for the variable listed in the second column. If the component finds the variable in the workspace, it includes it in the report.

    Parameter nameVariable name
    LoadExternalInputExternalInput
    SaveTimeTimeSaveName
    SaveStateStateSaveName
    SaveOutputOutputSaveName
    LoadInitialStateInitialState
    SaveFinalStateFinalStateName
  • Parent block: Includes the name of the block that contains the reported variable.

  • Calling string: Includes the MATLAB code that calls the reported variable.

  • Size of variable: Includes the size of the reported variable.

  • Class of variable: Includes the variable class to which the reported variable belongs.

  • Memory size: Includes the amount of memory in bytes that the reported variable needs.

  • Value in workspace: Includes the value of the reported variable.

    Large arrays may appear as [MxN CLASS]. For example, if you have a 300-by-200 double array, it appears in the report as [300x200 DOUBLE].

  • Storage class: Include the storage class of the reported variable.

    The title of this column is Storage Class. This option looks at the model's TunableVars property to see if any of the model variables specify their storage class. If you specify the storage class, TunableVarsStorageClass and TunableVarsTypeQualifier appear in a table column in the model variables table.

    The column entries are TunableVarsStorageClass (TunableVarsTypeQualifier) when TunableVarsTypeQualifier is not empty. If TunableVarsTypeQualifier is empty, the column entry is TunableVarsStorageClass.

    Values for TunableVarsStorageClass include:

    • Exported Global

    • Auto

    • ImportedExtern

    • ImportedExtern Pointer

  • Data object properties: For variables that are Simulink.Parameter data objects, includes the values of the object properties that you list in the edit box.

Example

This table is an example of a table created by the Model Variables component. This Property Table reports on the variables in the Controller in the f14 model.

Variable NameParent BlocksCalling StringValue

Ka

f14/Controller/Gain3

Ka

0.677

Kf

f14/Controller/Gain

Kf

-1.746

Ki

f14/Controller/Proportional plus integral compensator

[Ki]

-3.864

Kq

f14/Controller/Gain2

Kq

0.8156

Insert Anything into Report?

Yes. Table.

Class

rptgen_sl.csl_obj_fun_var