Main Content

Simulink.SimulationData.Parameter class

Package:Simulink.SimulationData

Stores logged parameter data and metadata

Description

TheSimulink.SimulationData.Parameterlogg对象存储数据和元数据ed block parameters. Tunable parameters connected to Dashboard blocks are logged to the Simulation Data Inspector during simulation. To access logged parameter data, you can export the simulation run from the Simulation Data Inspector using the UI or theSimulink.sdi.exportRunfunction. For more information about exporting simulation runs with the Simulation Data Inspector UI, seeExport Data to the Workspace or a File.

Construction

dataset= Simulink.sdi.exportRun(runID)返回一个Simulink.SimulationData.Parameterobject as an element indatasetwhen the run corresponding torunIDcontains logged parameter data.

Input Arguments

expand all

Run ID for the run containing logged parameter data. Run IDs are assigned by the Simulation Data Inspector. You can get the run ID for a simulation run using theSimulink.sdi.getAllRunIDsorSimulink.sdi.getRunIDByIndexfunction.

Output Arguments

expand all

Simulink.SimulationData.Datasetobject containing the run data and metadata. When the run contains logged parameter data, the dataset contains aSimulink.SimulationData.Parameterobject as an element for each logged parameter. TheSimulink.SimulationData.Parameterelement takes the name of the logged parameter. You can access aSimulink.SimulationData.Parameterobject usingget.

Properties

expand all

Parameter name as it appears in the label for the Dashboard block.

Example:'Mu:Gain'

Path to the block the parameter or variable corresponds to, returned as aSimulink.SimulationData.BlockPathobject.

Example:vdp/Mu

Name of the logged parameter as it appears in the block dialog box. For variables, theParameterNameproperty is empty.

Example:'Gain'

Name of the logged variable. For parameters, theVariableNameproperty is empty.

Example:'Zw'

timeseriesof parameter values. For logged variables, thetimeseriesname is the variable name. For logged parameters, thetimeseriesname is empty.

Methods

plot Plot simulation output data in the Simulation Data Inspector

Copy Semantics

Value. To learn how value classes affect copy operations, seeCopying Objects.

Examples

collapse all

This example shows how to access logged parameter data. Parameter data automatically logs to the Simulation Data Inspector when you connect a Dashboard block to a block parameter. Parameter data does not export to the workspace with other simulation data at the end of simulation. You can access the logged parameter data by exporting the run containing it from the Simulation Data Inspector.

Log Parameter Data

Run a simulation of the modelex_vdp_param, a modified version of thevdpmodel with an Edit block connected to the gain parameter of the Mu block. The parameter data logs with the signal data for signals marked for logging.

sim('ex_vdp_param');

Export Run

Use the Simulation Data Inspector programmatic interface to get the run ID for theex_vdp_paramsimulation, and export the run.

index = Simulink.sdi.getRunCount; runID = Simulink.sdi.getRunIDByIndex(index); dataset = Simulink.sdi.exportRun(runID);

访问Parameter Data

Use thegetmethod to access theSimulink.SimulationData.Parameterobject for the logged parameter data. TheValuesproperty contains the timeseries data for the parameter.

muGain = dataset.get('Mu:Gain')
muGain = Simulink.SimulationData.Parameter Package: Simulink.SimulationData Properties: Name: 'Mu:Gain' BlockPath: [1x1 Simulink.SimulationData.BlockPath] Values: [1x1 timeseries] Methods, Superclasses
Introduced in R2018a