Main Content

Data history (last N steps)

Number of data points to log

Model Configuration Pane: Simscape

Description

Limit the number of data points output to workspace to the last N steps of the simulation, where N is the value you specify for the Data history (last N steps) parameter. If the simulation contains fewer steps than the number specified, the workspace variable contains the data points for the whole simulation.

You can use this parameter together with the Decimation parameter. For example, if you specify a decimation factor of 2 and keep the default value of 10000 for the Data history (last N steps) parameter, your workspace variable will contain downsampled data from the last 20,000 time steps in the simulation.

Dependencies

To enable the Data history (last N steps) parameter, select the Limit data points check box.

Settings

10000 (default) | positive integer

Number of steps to log to workspace.

Tips

  • Saving data to workspace can slow down the simulation and consume memory. Use this parameter to limit the number of data points saved.

  • Another way to limit the number of data points saved is using the Decimation parameter. The two methods work independently from each other and can be used separately or together.

  • An alternative way to reduce memory consumption is to enable data streaming to disk, as described in Stream Logging Data to Disk.

  • The Output options parameter, under Additional parameters on the Data Import/Export pane of the Configuration Parameters dialog box, also affects which data points are logged.

Recommended Settings

ApplicationSetting
DebuggingNo Impact
TraceabilityNo Impact
EfficiencyNo Impact
Safety precautionNo Impact

Programmatic Use

Parameter: SimscapeLogDataHistory
Type: numeric
Value: positive integer
Default: 10000

Version History

Introduced in R2010b