Dataset Conversion for Logged Data
Why Convert to Dataset Format?
You can use the
constructor to convert a MATLAB® workspace variable that contains data that was logged in one of these formats
Structure with time
Converting data from other Simulink® logging formats to
Dataset format simplifies
writing scripts to post-process data logged. For example, a model with multiple To
Workspace blocks can use different data formats. Converting the logged data to
Dataset format avoids the need to write special code to handle
Different simulation modes have different levels of support for data logging formats. Switching between normal and accelerator modes can require changes to the logging formats used.
The conversion to
Dataset format also makes it easier to
take advantage of features that require
Dataset format. You can
easily convert data logged in earlier releases that used a format other
Dataset to work well
Dataset data in a more recent release.
timeseriesobjects to store logged data, which allows you to work with logging data in MATLAB without a Simulink license. For example, to manipulate the logged data, you can use MATLAB time-series methods such as
Supports logging multiple data values for a given time step, which is important for Iterator subsystem and Stateflow® signal logging.
By default, the resulting
Dataset object uses the variable name as
its name. You can use a name-value pair to specify a
You can use the
concat method to
Dataset objects into one
Results of Conversion
Dataset objects hold data as elements. To display the elements of a
Dataset variable, enter the variable name at the MATLAB command prompt. The elements of
Dataset objects are
different types, depending on the data they store. For example, signal logging stores data
elements and state
Dataset format stores data as
element holds data as a MATLAB time-series object. At conversion, the elements and time-series field populate
as much as possible from the converted object.
|Format||Conversion Result Notes|
MATLAB time series
If you log nonbus data, during conversion, the software first adds the
data as a
If you log bus data in time-series
format, one time series corresponds to each element of a bus. Converting arranges
the logged data as a structure with time-series objects as leaf nodes. This
structure hierarchy matches the bus hierarchy. Conversion of this type of
structure of time-series objects adds the whole structure to a
Time-series objects hold relevant information such as block path and timestamps. The conversion tries to preserve this information.
Structure and structure with time
Structure and structure with time formats do not always contain as much
information as if you log in
Conversion populates a
When scope data is logged in
structure format, the logged structure has a
Arrays contain little information. For example, there is no block path information.
Conversion adds the array to a
Converts data from
Dataset Conversion Limitations
Converting logged data to
Datasetformat results in a
Datasetobject that contains all the information that the original logged data included. However, if there is no corresponding information for the other
Datasetproperties, the conversion uses default values for that information.
When you convert data for a variable-size signal logged using the To Workspace block, the information in the
valueDimensionsfield of the structure is lost in the conversion.
When you log a bus signal in array, structure, or structure with time formats, the logged data is organized with:
The first column containing the data for the first signal in the bus
The second column containing data for the second bus signal, and so on
When you convert that data to
Datasetpreserves that organization. But if you log the bus signal in
Datasetformat without conversion, the conversion captures the bus data as a structure of time-series objects.
If the logged data does not include a time vector, when you convert that data to
Dataset, the conversion inserts a time vector. There is one time step for each data value. However, the simulation time steps and the
Datasettime steps can vary.
Datasetformat ignores the specification of frame signals. Conversion of structure or structure with time data to
Datasetreshapes the data for logged frame signals.