Main Content

convertToDataset

(Not recommended) Convert data logged using ModelDataLogs format to Dataset format

    The ability to log and load data using the ModelDataLogs format has been removed. Use another supported format, such as Dataset, instead. For more information, see Compatibility Considerations.

    Description

    ds = convertToDataset(mdlObj,dsName) converts the data in the Simulink.ModelDataLogs object mdlObj to a Simulink.SimulationData.Dataset with the name specified by dsName. The output ds is a Dataset object that contains a flat list with an element for each Simulink.Timeseries, Simulink.ModelDataLogs, Simulink.TSArray, and Simulink.SubsysDataLogs object inside mdlObj.

    You can also use the Simulink.SimulationData.Dataset function to convert data from the ModelDataLogs format to the Dataset format.

    Input Arguments

    collapse all

    Data to convert, specified as a Simulink.ModelDataLogs object.

    Name of Dataset object to contain converted data, specified as a character vector.

    Output Arguments

    collapse all

    Converted data, returned as a Simulink.Simulationdata.Dataset object.

    Limitations

    Source of Simulink.ModelDataLogs DataConversion Limitation

    Model reference

    Conversion fails if any ancestor of the model reference is not on the MATLAB® path.

    Conversion might fail if the model reference or any ancestors of the model reference have changed since the Simulink.ModelDataLogs object was created. For example, adding, deleting, or renaming a block after the object was created can cause conversion to fail.

    Variant model or subsystem

    Conversion fails if the current active variant is not the same as the active variant when the Simulink.ModelDataLogs object was created.

    Frame signal

    Not supported.

    Mux block

    Conversion produces a different Dataset object than logging the output using the Dataset format would produce.

    Stateflow® chart

    Not supported.

    Version History

    Introduced in R2011a

    expand all

    R2022b: Loading data saved in the ModelDataLogs format no longer supported

    Starting in R2022b, you can no longer load data stored in the ModelDataLogs format, including data stored in Simulink.Timeseries, Simulink.TSArray, and Simulink.SubsysDataLogs objects.

    You can convert data stored in the ModelDataLogs format to the Dataset format. For more information, see Convert Data to Dataset Format.