Main Content

exportToPreviousRelease

R2026b

Save Dataset object to MAT file you can open in any release

Description

exportToPreviousRelease(ds,filename,dsname) saves the Simulink.SimulationData.Dataset object, ds, to the MAT file specified by the filename input, using the name specified by the dsname input. You can load the Dataset object saved in the file in any release that supports the Dataset format. When you do not use this function to save a Dataset object to a file, you may not be able to load the data in releases prior to R2017a. When you do not need to open and use the Dataset data in a release prior to R2017a, you can use the save function.

example

exportToPreviousRelease(___,version) specifies the MAT file version.

exportToPreviousRelease(___,'–append') adds data stored in a Dataset object to a MAT file you can load in a previous release without overwriting the contents of the MAT file.

exportToPreviousRelease(___,'–nocompression') saves the Dataset object to a MAT file without compression. The '–nocompression' option only supports Version 7 and Version 7.3 MAT files.

Examples

collapse all

Export a Simulink.SimulationData.Dataset object to a MAT file that you can load in any release.

exportToPreviousRelease(myDataset,"myFile.mat","myData")

Input Arguments

collapse all

Data you want to load in a release prior to R2017a, specified as a Simulink.SimulationData.Dataset object.

Example: out.logsout

Name of the file to export data to, specified as a string or character vector. If the file does not exist, the exportToPreviousRelease function creates the file. When the file exists, you can overwrite the data in the file, or you can use the "–append" input to append the Dataset data to the file.

Example: "myfile.mat"

Data Types: char | string

Name of the Dataset object saved in the MAT file, specified as a string or character vector. The name does not have to match the name of the Dataset object containing the data you want to save in the MAT file.

Example: "myLoggedData"

Data Types: char | string

MAT file version. By default, the exportToPreviousRelease function creates Version 7 MAT files, unless you have changed the preference for the default MAT file version created by save operations. For more information, see MAT File Versions. You cannot save Dataset data to Version 4 MAT files.

Data Types: char | string

Version History

Introduced in R2019b