| Contents | Index |
Simulink.SimulationData.updateDatasetFormatLogging(top_model)
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. 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
Simulink checks signal logging data format consistency for certain model referencing configurations. For details, see Model Reference Signal Logging Format Consistency. One approach for handling reported inconsistencies is to use the Simulink.SimulationData.updateDatasetFormatLogging function to update the whole model to use Dataset format. This approach avoids you having to set the Configuration Parameters > Data Import/Export > Signal logging format parameter individually for each referenced model and each variant. However, the update can cause changes to the model hierarchy.
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.
MathWorks recommends that you use the Dataset format for signal logging. 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.
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.
Convert sldemo_mdlref_variants to use Dataset format for signal logging for the top-level model and all of its referenced models and variants and review results. This example updates the model, but does not save the changes because you cannot write to the sldemo_mdlref_variants demo. If you want to save the updated models, then before you use the Simulink.SimulationData.updateDatasetFormatLogging function, save the following model files to another folder. Make that folder the current MATLAB folder.
Top-level model
Referenced models
Variant models
sldemo_mdlref_variants;
Simulink.SimulationData.updateDatasetFormatLogging('sldemo_mdlref_variants', 'AllVariants')Simulink.ModelDataLogs | Simulink.ModelDataLogs.convertToDataset | Simulink.SimulationData.Dataset

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |