Main Content

convertToDataset

(Removed) Convert data logged using ModelDataLogs format to Dataset format

    The convertToDataset function has been removed. Support for the ModelDataLogs format will be removed. Use another supported format, instead. For more information, see Version History.

    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.

    example

    Examples

    collapse all

    If you have already logged signal data in the ModelDataLogs format, you can use the convertToDataset function to update the ModelDataLogs signal logging data to use Dataset format. For example, update the older_model_data from ModelDataLogs format to Dataset format.

    new_dataset = convertToDataset(logsout,"older_model_data")

    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

    R2024b: Removed

    The convertToDataset function has been removed. To convert data logged in ModelDataLogs format to Dataset format, use a version of Simulink prior to the R2024b release.