contents

View the contents of the Simulink.SimulationInput object

Description

contents(in) displays the contents of the Simulink.SimulationInput object as a table. The method, contents, 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

This example shows the contents of the Simulink.SimulationInput object by using the contents method on the object.

Open and Load Model

Open and load the model .

open_system('ex_sldemo_househeat')
load_system('ex_sldemo_househeat')

Create a SimulationInput Object for a Model

Create a Simulink.SimulationInput object for the model ex_sldemo_househeat.

in = Simulink.SimulationInput('ex_sldemo_househeat');

Set a Variable and Model Parameters on the Model

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

View the Contents of the Simulink.SimulationInput Object, in

in.contents
    ModelName: 'ex_sldemo_househeat'

    ModelParameters: 
    Index    Name     Value
    _____    _____    _____

      1      Start    '0'  
      2      Stop     '50' 


    Variables: 
    Index    Name    Value       Workspace    
    _____    ____    _____    ________________

      1      cost     50      global-workspace


Input Arguments

collapse all

A Simulink.SimulationInput object that is used to specify changes to the model for a simulation.

Introduced in R2020a