Main Content

convertToSLDataset

Convert contents of MAT file to Simulink.SimulationData.Dataset object in another MAT file

Description

s = convertToSLDataset(source,destination) converts the contents of the MAT file source to the destination MAT file destination.

s = convertToSLDataset(source,destination,dsname) names the Simulink.SimulationData.Dataset object in the destination file according to the name dsname.

When converting structure data, the function names each element in the Dataset object using the value in the label field of the structure signal field, such as mySignal.signal(1).label.

This function ignores time expressions in source.

example

Examples

collapse all

Convert signals in file1.mat to a Dataset object in file2.mat.

s = convertToSLDataset("file1.mat","file2.mat");

Convert signals in file1.mat to a Dataset object named myDataset in file2.mat.

s = convertToSLDataset("file1.mat","file2.mat","myDataset");

Input Arguments

collapse all

MAT file that contains data to convert, specified as a string or a character vector that defines the name of the file.

MAT file to contain data converted to Dataset format, specified as a string or a character vector that defines the name of the destination file.

Name for Dataset object in destination file, specified as a string or a character vector.

Output Arguments

collapse all

Outcome of conversion, returned as logical 1 (true) or 0 (false)

  • 1 (true) — Conversion was successful.

  • 0 (false) — Conversion was not successful.

Version History

Introduced in R2016a