Main Content

showContents

View the contents of theSimulink.SimulationInputobject

Description

example

showContents(in)displays the contents of theSimulink.SimulationInputobject as a table. The method,showContents, lets you view all the information such as block parameters, variables, model parameters, external Inputs and the initial states that are set in theSimulink.SimulationInputobject. You can view the contents of a singleSimulink.SimulationInputobject at a given time.

Examples

collapse all

This example shows the contents of theSimulink.SimulationInputobject by using theshowContentsmethod on the object.

Open and Load Model

Open and load the model .

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

创建一个SimulationInput Object for a Model

创建一个Simulink.SimulationInputobject for the modelex_sldemo_househeat.

in = Simulink.SimulationInput('ex_sldemo_househeat');

Set a Variable and Model Parameters on the Model

in = in.setVariable(“成本”,50); in = in.setModelParameter('Start','0','Stop','50');

View the Contents of the Simulink.SimulationInput Object,in

in.showContents
ModelName: 'ex_sldemo_househeat' ModelParameters: Index Name Value _____ _____ _____ 1 Start '0' 2 Stop '50' Variables: Index Name Value Workspace _____ ____ _____ ________________ 1 cost 50 global-workspace RuntimeFcns: 1x1 RuntimeFcns

Input Arguments

collapse all

ASimulink.SimulationInputobject that is used to specify changes to the model for a simulation.

Version History

Introduced in R2020a