Main Content

Simulink.SimulationData.updateDatasetFormatLogging

Convert model and its referenced models to useDatasetformat for signal logging

Syntax

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

Description

Note

TheModelDataLogsclass is supported for backwards compatibility. Starting in R2016a, you cannot log data in theModelDataLogs格式。Signal logging uses theDataset格式。在R2016a or later, when you open a model from an earlier release that had usedModelDataLogsformat, the model simulated in useDataset格式。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 usesDatasetformat for all signal logging.

You can convert signal logging data fromModelDataLogstoDataset格式。Converting toDatasetformat makes it easier to post-process with other logged data (for example, logged states), which can also useDataset格式。For more information, seeConvert Logged Data to Dataset Format.

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

Simulink.SimulationData.updateDatasetFormatLogging(top_model)converts the top-level model and all of its referenced models to use theDatasetformat for signal logging instead of theModelDataLogs格式。You can convert signal logging data fromModelDataLogstoDataset格式。Converting toDatasetformat makes it easier to post-process with other logged data (for example, logged states), which can also useDataset格式。For more information, seeConvert Logged Data to Dataset Format.

If a Model block has theGenerate preprocessor conditionalsoption selected, the function converts all the variants; otherwise, the function converts only the active variant.

Simulink.SimulationData.updateDatasetFormatLogging(top_model,variants)指定variant models to convert to use theDatasetsignal logging format. For details about thevariantsargument, see在put Arguments

在put 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

TheDatasetformat causes Simulink®to use aSimulink.SimulationData.Datasetobject to store the logged signal data. TheDatasetformat use MATLAB®timeseriesobjects to formatting the data.

ModelDataLogs

TheModelDataLogsformat causes Simulink to use aSimulink.ModelDataLogsobject to store the logged signal data.Simulink.TimeseriesandSimulink.TsArrayobjects provide the format for the data.

Tips

  • The conversion function sets theSignalLoggingSaveFormatparameter value toDatasetfor 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 theDataset格式。

在troduced in R2011a