Main Content


Extract signal logging objects from signal logs and write them into MATLAB workspace





The ModelDataLogs class is supported for backwards compatibility. Starting in R2016a, you cannot log data in the ModelDataLogs format. Signal logging uses the Dataset format. In R2016a or later, when you open a model from an earlier release that had used ModelDataLogs format, the model simulated in use Dataset format.

You can convert signal logging data from ModelDataLogs to Dataset format. Converting to Dataset format makes it easier to post-process with other logged data (for example, logged states), which can also use Dataset format. For more information, see Convert Logged Data to Dataset Format.

If you have legacy code that uses the ModelDataLogs API, you can encounter situations that require updates to your code or model. See Migrate Scripts That Use Legacy ModelDataLogs API.

log.unpack or unpack(log) extracts the top level elements of the Simulink.ModelDataLogs or Simulink.SubsysDataLogs object named log (e.g., logsout).

log.unpack('systems') or unpack(log, 'systems') extracts Simulink.Timeseries and Simulink.TsArray objects from the Simulink.ModelDataLogs or Simulink.SubsysDataLogs object named log . This command does not extract Simulink.Timeseries objects from Simulink.TsArray objects nor does it write intermediate Simulink.ModelDataLogs or Simulink.SubsysDataLogs objects to the MATLAB® workspace.

log.unpack('all') or unpack(log, 'all') extracts all the Simulink.Timeseries objects contained by the Simulink.ModelDataLogs, Simulink.TsArray, or Simulink.SubsysDataLogs object named log.

tsarray.unpack extracts the time-series objects of class Simulink.Timeseries from the Simulink.TsArray object named tsarray.

Version History

Introduced before R2006a