getSimulationMetadata - Access simulation metadata in Simulink.SimulationOutput

  object - MATLAB ([original](https://in.mathworks.com/help/simulink/slref/simulink.simulationoutput.getsimulationmetadata.html)) ([raw](?raw))

Main Content

Access simulation metadata in Simulink.SimulationOutput object

Syntax

Description

[simMeta](#mw%5F45e6dadf-ef13-44fd-832a-87c52f5bdeb5) = getSimulationMetadata([simOut](#mw%5Fe743c7d9-43b4-4d5b-b547-140e21957231)) returns the simulation metadata stored in the Simulink.SimulationOutput object simOut. The simulation metadata includes information about the model, simulation execution and timing, and details about errors and warnings that occurred during the simulation.

You can also get the simulation metadata using a dot to access the value of theSimulationMetadata property.

simmetadata = out.SimulationMetadata;

example

Examples

collapse all

The software returns simulation metadata as aSimulink.SimulationMetadata object when you run simulations in a way that returns results as a single Simulink.SimulationOutput object. To access the simulation metadata, you can use dot notation to access theSimulationMetadata property of theSimulationOutput object or use thegetSimulationMetadata function.

Open the model vdp.

mdl = "vdp"; openExample("simulink_general/VanDerPolOscillatorExample", ... SupportingFile=mdl)

Simulate the model. The simulation returns results as a singleSimulationOutput object because the model vdp has the Single simulation output parameter enabled.

Get the simulation metadata using the getSimulationMetadata function.

simmeta = getSimulationMetadata(out)

simmeta =

SimulationMetadata with properties:

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

Input Arguments

Output Arguments

Version History

Introduced in R2015a

expand all

To access simulation metadata, you can now use theSimulationMetadata property of theSimulink.SimulationOutput object. To access simulation metadata in previous releases, you had to use the getSimulationMetadata function.