Main Content


Convert contents of MAT-file to Simulink.SimulationData.Dataset object



success=convertToSLDataset(source,destination) converts the contents of a MAT-file (source) to a destination MAT-file (destination).

success=convertToSLDataset(source,destination,datasetname) names the dataset datasetname.

When converting structure signal data, the function names the signal using the value contained in the label field of the structure signal field, such as: mySignal.signal(1).label.

This function ignores time expressions in source.


collapse all

Save signals from file1.mat to a dataset named file1 in file2.mat.


Save signals from file1.mat to a dataset named myDataset in file2.mat.


Input Arguments

collapse all

MAT–file that contains Simulink® inputs.

MAT–file to contain Simulink.SimulationData.Dataset converted from contents of source.

Data set name for new Simulink.SimulationData.Dataset object.

Output Arguments

collapse all

Outcome of conversion, specified as binary:

  • 1

    Conversion is successful.

  • 0

    Conversion is not successful.

Version History

Introduced in R2016a