Guy on Simulink

Simulink & Model-Based Design

Simulation Metadata! 1

Posted by Guy Rouleau,

Did you notice that in R2015a, simulations now have metadata in their output?

Simulation Metadata

What is simulation metadata?

The getSimulationMetadata method of the Simulink.SimulationOutput object returns a Simulink.SimulationMetadata object. It has four properties: ModelInfoTimingInfoUserString, and UserData. ModelInfo contains some basic information about the model and solver.

Model Metadata

Timing information

No more need to insert tic and toc calls in your model callbacks. The TimingInfo field of the metadata informs you of the time it took for your model to initialize, execute, and terminate:

Model Metadata TimingInfo

Custom information

If you want to add notes or relevant data, you can use the UserString and UserData properties. They can be set using their respective methods of the parent Simulink.SimulationOutput object: setUserString and setUserData.

Model Metadata setUserString

Now it's your turn

What are you going to store in the Simulink.SimulatuonOutput UserData field? Let us know by leaving a comment here.

1 CommentsOldest to Newest

Shawn Bonneau replied on : 1 of 1
The ExecutionInfo field (which appears to have been added in a slightly later release) is exactly what I needed for the task I am working on now. This is so much easier to determine which (if any) Stop Simulation block caused the simulation to end.