Main Content

showContents

View contents of Simulink.SimulationInput object

Since R2020a

Description

example

showContents(simIn) displays the contents of the Simulink.SimulationInput object simIn as a table. The function lets you view all the information such as block parameters, variables, model parameters, external Inputs and the initial states that are set in the Simulink.SimulationInput object. You can view the contents of a single Simulink.SimulationInput object at a given time.

Examples

collapse all

Use the showContents function to view the simulation configuration stored in a Simulink.SimulationInput object.

Open the model .

open_system('ex_sldemo_househeat')

Create a Simulink.SimulationInput object for the model ex_sldemo_househeat.

simIn = Simulink.SimulationInput('ex_sldemo_househeat');

Configure a variable value and model parameter values on the Simulink.SimulationInput object.

simIn = setVariable(simIn,'cost',50);
simIn = setModelParameter(simIn,'Start','0','Stop','50');

View the configuration stored on the Simulink.SimulationInput object.

showContents(simIn)
    ModelName: 'ex_sldemo_househeat'

    ModelParameters: 
    Index    Name     Value
    _____    _____    _____

      1      Start    '0'  
      2      Stop     '50' 


    Variables: 
    Index    Name    Value       Workspace          Context  
    _____    ____    _____    ________________    ___________

      1      cost     50      global-workspace    <undefined>


    RuntimeFcns: 1x1 RuntimeFcns

Input Arguments

collapse all

Simulation inputs and configuration, specified as a Simulink.SimulationInput object.

Version History

Introduced in R2020a