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


Simulink.SimulationData.updateDatasetFormatLogging(top_model, variants)


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


String that specifies the name of the top-level model.


String 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

expand all


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.


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.


  • Simulink checks signal logging data format consistency for certain model referencing configurations. For details, see Model Reference Signal Logging Format Consistency. You can use the Upgrade Advisor (with the upgradeadvisor function) to upgrade a model to use Dataset format.

  • An alternative approach for handling reported inconsistencies is to use the Simulink.SimulationData.updateDatasetFormatLogging function to update the models to use Dataset format. This approach sets the Model Configuration Parameters > Data Import/Export > Signal logging format parameter to Dataset for each referenced model and each variant.

  • 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.

  • For new models, use the Dataset format for signal logging. The ModelDataLogs format will be removed in a future release. For an existing model that uses the ModelDataLogs format, you should migrate the model to use Dataset format. For details, see Migrate from ModelDataLogs to Dataset Format.

    After conversion, to reset the format back to ModelDataLogs, you must set the Signal logging format parameter individually for each model. If you want to use the ModelDataLogs format for the model in the future, consider using one of these approaches:

    • Save a version of the model that uses the ModelDataLogs format.

    • Use the conversion function to convert the model to use Dataset format for signal logging and run the simulation in Normal mode. However, do not save the changes.

Introduced in R2011a

Was this topic helpful?