Simulink.SimulationData.updateDatasetFormatLogging

Convert model and its referenced models to use Dataset format for signal logging

Syntax

Simulink.SimulationData.updateDatasetFormatLogging(top_model)
Simulink.SimulationData.updateDatasetFormatLogging(top_model, variants)

Description

Note

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 do not need to use this command to update the signal logging format for a model that uses model referencing. Opening the model in R2016a or later uses Dataset format for all signal logging.

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.

Simulink.SimulationData.updateDatasetFormatLogging(top_model) converts the top-level model and all of its referenced models to use the Dataset format for signal logging instead of the ModelDataLogs 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 a Model block has the Generate preprocessor conditionals option selected, the function converts all the variants; otherwise, the function converts only the active variant.

Simulink.SimulationData.updateDatasetFormatLogging(top_model, variants) specifies which variant models to convert to use the Dataset signal logging format. For details about the variants argument, see Input Arguments

Input Arguments

top_model

Character vector that specifies the name of the top-level model.

variants

Character vector that specifies which variant models to update:

  • 'ActivePlusCodeVariants' — (Default) Search all variants if any generate preprocessor conditionals. Otherwise, search only the active variant.

  • 'ActiveVariants' — Convert only the active variant.

  • 'AllVariants' — Convert all variants.

More About

collapse all

Dataset

The Dataset format causes Simulink® to use a Simulink.SimulationData.Dataset object to store the logged signal data. The Dataset format use MATLAB® timeseries objects to formatting the data.

ModelDataLogs

The ModelDataLogs format causes Simulink to use a Simulink.ModelDataLogs object to store the logged signal data.Simulink.Timeseries and Simulink.TsArray objects provide the format for the data.

Tips

  • The conversion function sets the SignalLoggingSaveFormat parameter value to Dataset for all the updated models.

  • If you want to save the format updates that the conversion function makes, then ensure that the top-level model, referenced models, and variant models are accessible and writable.

  • If a model has no other unsaved changes, the conversion function saves the format updates to the model. If the model has unsaved changes, the function updates the format, but does not save those changes.

  • If you use this function for a model that does not include any referenced models, the function converts the top-level model use the Dataset format.

Introduced in R2011a