Export model or library for use in previous version of Simulink
the model or library
exported_file = Simulink.exportToVersion(
modelname to a file named
a format that the specified previous Simulink®
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.
is a legacy option for this functionality that is also supported.
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.
modelname— Model to export
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.
target_filename— Exported file name
Exported file name, specified as a character vector. The target file must not be the same as the model file.
version— MATLAB® release name
MATLAB release name,
specified as a character vector, which specifies a previous Simulink version.
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.
You can specify model file format as SLX or MDL using the suffix
_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
Simulink.exportToVersion, then the Save
as type list supports 7 years of previous releases.
comma-separated pairs of
the argument name and
Value is the corresponding value.
Name must appear inside quotes. You can specify several name and value
pair arguments in any order as
'AllowPrompt'— Allow prompt or message dialog box
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
'BreakUserLinks'— Break user-defined links
Break user-defined links, specified by a logical value that indicates whether the function replaces links to user-defined library blocks with copies of the library blocks in the saved file.
'BreakToolboxLinks'— Break all toolbox links
Break all toolbox links, specified by a logical value that indicates
whether the function replaces links to built-in MathWorks® library
blocks with copies of the library blocks in the saved file. The
affects Simulink library blocks and blocks from any other libraries
supplied with MathWorks toolboxes or blocksets.
'BreakToolboxLinks' option can result
in compatibility issues when upgrading to newer versions of Simulink software.
Any masks on top of library links to Simulink S-functions will not upgrade to the new version of the S-function.
Any library links to masked subsystems in a Simulink library will not upgrade to the new subsystem behavior.
Any broken links prevent the automatic library forwarding mechanism from upgrading the link.
If you have saved a model with broken links to built-in libraries, use the Upgrade Advisor to scan the model for out-of-date blocks and upgrade the Simulink blocks to their current versions.
exported_file— Exported file
Path of the exported file, returned in the format that the specified previous Simulink version can load.