Main Content

showContents

View summary of specification in SimulationInput or Simulation object

Since R2020a

Description

example

showContents(s) displays a table that summarizes the simulation specification stored in the Simulink.SimulationInput or Simulation object s.

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>

Input Arguments

collapse all

Simulation specification or simulation, specified as a Simulink.SimulationInput object or a Simulation object.

A SimulationInput object represents a simulation specification that includes the initial state, external inputs, model parameter values, block parameter values, and variable values to use in the simulation.

The Simulation object represents a simulation and provides an interface for controlling and interacting with the simulation.

Version History

Introduced in R2020a

expand all