Export model or library for use in previous version of Simulink


exported_file = Simulink.exportToVersion(modelname,target_filename,version)
exported_file = Simulink.exportToVersion(modelname,target_filename,version,Name,Value)



exported_file = Simulink.exportToVersion(modelname,target_filename,version) exports the model or library modelname to a file named target_filename in a format that the specified previous Simulink® version can load.

If the system contains functionality not supported by the specified Simulink software version, the command removes the functionality and replaces any unsupported blocks with empty masked subsystem blocks colored yellow. As a result, the converted system may generate different results.

The save_system ExportToVersion option is a legacy option for this functionality that is also supported.


exported_file = Simulink.exportToVersion(modelname,target_filename,version,Name,Value) specifies additional options as one or more Name, Value pair arguments.


collapse all

Get the current top-level system and export it.


Get the current top-level system and export it, replacing links to library blocks with copies of the library blocks in the saved file.


Input Arguments

collapse all

Model to export, specified as a character vector, without any file extension. The model must be loaded and unmodified. The target file must not be the same as the model file.

Data Types: char

Exported file name, specified as a character vector. The target file must not be the same as the model file.

Example: 'mymodel.slx'

Data Types: char

MATLAB release name, specified as a character vector, which specifies a previous Simulink version. Simulink.exportToVersion exports the system to a format that the specified previous Simulink version can load. You cannot export to your current version. These version names are not case sensitive.

To export to Release 2012a and later, you can specify model file format as SLX or MDL using the suffix _MDL or _SLX. If you do not specify a format, you export your default model file format.

If you use the Export to Previous Version dialog box instead of Simulink.exportToVersion, then the Save as type list supports 7 years of previous releases.

Example: 'R2015B'

Data Types: char

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.


collapse all

Allow prompt or message dialog box, specified by a logical value that indicates whether to display any output prompt or message in a dialog box or only messages at the command line. For example, prompts to make files writable, or messages about exported versions. If you want to allow prompts, then set to true. or on.

Output Arguments

collapse all

Exported file, returned in the format that the specified previous Simulink version can load.

Introduced in R2016a

Was this topic helpful?