Convert model and its referenced models to use Dataset
format
for signal logging
Simulink.SimulationData.updateDatasetFormatLogging(top_model)
Simulink.SimulationData.updateDatasetFormatLogging(top_model, variants)
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(
converts
the top-level model and all of its referenced models to use the top_model
)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(
specifies
which variant models to convert to use the top_model
, variants
)Dataset
signal
logging format. For details about the variants
argument,
see Input Arguments
|
Character vector that specifies the name of the top-level model. |
|
Character vector that specifies which variant models to update:
|
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.
Simulink.ModelDataLogs
| Simulink.ModelDataLogs.convertToDataset
| Simulink.SimulationData.Dataset