| Contents | Index |
convertedDataset = sourceModelDataLogsObject.convertToDataset(convertedDatasetName)
convertedDataset = sourceModelDataLogsObject.convertToDataset(convertedDatasetName) converts the sourceModelDataLogsObject to a Simulink.SimulationData.Dataset object. The name of the converted object is based on convertedDatasetName.
The resulting Simulink.SimulationData.Dataset object is a flat list. This list has one element for each Simulink.Timeseries or Simulink.TsArray object in the Simulink.ModelDataLogs object.
| Source of Simulink.ModelDataLogs Logged Data | Conversion Limitation |
|---|---|
Referenced model | Loads all ancestors of the referenced model not previously loaded. If any ancestor model does appear not on the MATLAB path, the conversion fails. If the model has changed, or the model's ancestors have changed, after Simulink logged the data, the conversion may fail. For example, adding, deleting, or renaming a block after logging can cause conversion failure. |
Variant model or subsystem | The current active variant must be the same one that was activeas when Simulink logged the data. Otherwise, the conversion fails. |
Frame signal | The conversion fails. |
Mux block | The conversion produces a different Simulink.SimulationData.Dataset object as the dataset than Simulink creates when you simulate the model using the Dataset format for the logged data . |
Stateflow chart | Not supported. |
convertedDataset |
The Simulink.SimulationDataset object that the Simulink.ModelDataLogs.convertToDataset function creates. For details about the converted dataset, see Simulink.SimulationData.Dataset. |
Log signal data, simulate the model, and then convert the logged dataset to the Simulink.SimulationData.Dataset format.
Open the vdp model by typing:
vdp
Right-click the x1 signal and select the Signal Properties menu item.
Select the Log signal data property.
Repeat steps 2 and 3 for the x2 signal.
Simulate the model.
Note that the vdp model has the Configuration Parameters > Data Import/Export > Signal logging parameter selected, and the signal logging object name set to logsout. Also, the Signal Logging Format parameter is set to ModelDataLogs.
At the MATLAB command line, type:
logsout
logsout = Simulink.ModelDataLogs (vdp): Name Elements Simulink Class x1 1 Timeseries x2 1 Timeseries
Convert the logged dataset to use the Simulink.SimulationDataset format:
dataset = logsout.convertToDataset('vdp_dataset')
dataset =
Simulink.SimulationData.Dataset
Package: Simulink.SimulationData
Characteristics:
Name: 'vdp_dataset'
Total Elements: 2
Elements:
1: 'x1'
2: 'x2'
Use getElement to access elements by index, name or block path.
Methods, SuperclassesSimulink.ModelDataLogs | Simulink.SimulationData.Dataset | Simulink.SimulationData.updateDatasetFormatLogging

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 |