Simulink.SimulationMetadata
Information about model, environment, execution, and timing of simulation
Description
A Simulink.SimulationMetadata
object contains information about
the configuration and environment in which a simulation ran.
The simulation configuration, such as model name and version, simulation start and stop time, and the simulation mode
The environment in which the simulation ran, such as the name of the machine that ran the simulation and the operating system platform on which the simulation ran
Diagnostics issued during simulation
Simulation timing, including a breakdown of the time spent in the initialization, execution, and termination phases
The SimulationMetadata
object has properties you can modify to store
additional data and metadata and to save a description of the simulation.
When you run a profiling simulation using the Simulink Profiler,
the Simulink.profiler.Data
object that contains the profiling results is returned in
the SimulationMetadata
object.
Creation
The software creates a SimulationMetadata
object for every simulation you
run that returns results as a single SimulationOutput
object. The
SimulationMetadata
object is returned in the
SimulationMetadata
property of the Simulink.SimulationOutput
object that contains the simulation results. To extract
the SimulationMetadata
object from a SimulationOutput
object, use dot notation.
simmetadata = out.SimulationMetadata;
To ensure each simulation returns results as a single SimulationOutput
object, use one of these approaches:
Save the model with the Single simulation output enabled.
Enable the Single simulation output parameter for the simulation.
For example, in simulations you run using the
sim
function without aSimulationInput
object, enable theReturnWorkspaceOutputs
parameter by specifying a name-value argument or by setting the parameter in the parameter structure orSimulink.ConfigSet
input argument. This code enables the parameter by specifying a name-value argument.out = sim(mdl,ReturnWorkspaceOutputs="on");
The software always returns simulation results as a single output in these situations:
You simulate the model programmatically using one or more
Simulink.SimulationInput
objects.You can configure simulations using
SimulationInput
objects when you run simulations using thesim
,parsim
, andbatchsim
functions or using theSimulation
object.You simulate the model using a
sim
function syntax that returns results as a single simulation output.For more information, see
sim
.You run a set of simulations using the Multiple Simulations pane.