Simulink.SimulationData.updateDatasetFormatLogging
Convert model and its referenced models to useDataset
format for signal logging
Syntax
Simulink.SimulationData.updateDatasetFormatLogging(top_model)
Simulink.SimulationData.updateDatasetFormatLogging(top_model, variants)
Description
Note
TheModelDataLogs
class 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 usedModelDataLogs
format, 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 usesDataset
format for all signal logging.
You can convert signal logging data fromModelDataLogs
toDataset
格式。Converting toDataset
format 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 theModelDataLogs
API, you can encounter situations that require updates to your code or model. SeeMigrate Scripts That Use Legacy ModelDataLogs API.
Simulink.SimulationData.updateDatasetFormatLogging(
converts the top-level model and all of its referenced models to use thetop_model
)Dataset
format for signal logging instead of theModelDataLogs
格式。You can convert signal logging data fromModelDataLogs
toDataset
格式。Converting toDataset
format 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(
指定variant models to convert to use thetop_model
,variants
)Dataset
signal logging format. For details about thevariants
argument, see在put Arguments
在put Arguments
|
Character vector that specifies the name of the top-level model. |
|
Character vector that specifies which variant models to update:
|
More About
Tips
The conversion function sets the
SignalLoggingSaveFormat
parameter value toDataset
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
格式。
See Also
Simulink.ModelDataLogs
|Simulink.ModelDataLogs.convertToDataset
|Simulink.SimulationData.Dataset