Main Content

Data stores

Option to log data for Data Store Memory blocks

Model Configuration Pane: Data Import/Export


Specify whether the software logs all Data Store Memory block variables for the model to the specified MATLAB® variable.

By default, simulation results are returned as a single Simulink.SimulationOutput object. The logging variable you specify for logged data stores becomes a property of the SimulationOutput object. To access the logged data store data, use dot notation. For example, when you use the default output variable name out and the default states logging variable name dsmout, access the data store data using this code.

dsmout = out.dsmout;


on (default) | off

The software logs all Data Store Memory block variables to the workspace and the Simulation Data Inspector during simulation. By default, the logged data is stored in the variable dsmout. To save the data using a different variable name, specify a valid MATLAB variable name in the text box.

The variable must not have a name that matches the name of any object functions or properties of the Simulink.SimulationOutput object.

Data store logging always uses the Dataset format.


The software does not log Data Store Memory block variables.

Recommended Settings

The table summarizes recommended values for this parameter based on considerations related to code generation.

DebuggingNo impact
TraceabilityNo impact

No recommendation

Safety precautionNo recommendation

Programmatic Use

Parameter: DSMLogging
Value: 'on' | 'off'
Default: 'on'
Parameter: DSMLoggingName
Type: string | character vector
Value: valid MATLAB variable name
Default: 'dsmout'

Version History

Introduced in R2010a