getSimulationMetadata

Class: Simulink.SimulationOutput
Package: Simulink

Return SimulationMetadata object for simulation

Syntax

mData = simout.getSimulationMetadata()

Description

mData = simout.getSimulationMetadata() retrieves metadata information in a SimulationMetadata object from the simout SimulationOutput object.

Input Arguments

expand all

Simulation object to get metadata from, specified as a SimulationOutput object.

Output Arguments

expand all

SimulationMetadata object stored in the simout SimulationOutput object, returned as an object.

Examples

expand all

Simulate the vdp model and retrieve metadata information from the simulation.

Simulate the vdp model. Save the results of the Simulink.SimulationOutput object in simout

 open_system('vdp')
 simout = sim(bdroot,'ReturnWorkspaceOutputs','on');

Retrieve metadata information about this simulation using mData.

 mData=simout.getSimulationMetadata()
mData = 

  SimulationMetadata with properties:

        ModelInfo: [1x1 struct]
       TimingInfo: [1x1 struct]
    ExecutionInfo: [1x1 struct]
       UserString: ''
         UserData: []

Alternatives

A simpler alternative to use dot notation with the SimulationMetadata property. For example:

simOut.SimulationMetadata.ModelInfo

Another alternative is to display simulation metadata in the Variable Editor using one of these approaches:

  • Select the Show Simulation Metadata check box (which displays the data in a tree structure).

  • Double-click the SimulationMetadata row.

  • View the SimulationMetadata object.