Main Content


Class: slreq.LinkSet
Package: slreq

Export link set to previous MATLAB version


tf = exportToVersion(myLinkSet,name,version)


tf = exportToVersion(myLinkSet,name,version) saves a copy of the link set myLinkSet as a new link set file that is compatible with the MATLAB® version specified by version and with file name specified by name. The method returns 1 if the file is exported. The file is saved in the current folder.


You can only export link sets to version R2017b or later.

Input Arguments

expand all

Link set, specified as an slreq.LinkSet object.

File name for exported link set, specified as a string scalar or character vector.

MATLAB version to export to, specified as a string scalar or character vector.

You can export to version R2017b or later.

Example: tf = exportToVersion(myLinkSet,"newLinkSet","R2021a")

Output Arguments

expand all

Export success status, returned as a logical 1 (true) or 0 (false).

Data Types: logical


expand all

This example shows how to export a link set to a file that is compatible with a previous version of MATLAB.

Open the CruiseRequirementsExample project. Load the crs_req requirement set, which also loads the crs_req link set.


Find the crs_req link set and assign it to a variable.

myLinkSet = slreq.find("Type","LinkSet","Name","crs_req")
myLinkSet = 
  LinkSet with properties:

             Description: ''
                Filename: '/tmp/Bdoc22b_2134332_1900392/bml.batserve.3251661/MATLAB/Projects/examples/CruiseRequirementsExample4/documents/crs_req.slmx'
                Artifact: '/tmp/Bdoc22b_2134332_1900392/bml.batserve.3251661/MATLAB/Projects/examples/CruiseRequirementsExample4/documents/crs_req.slreqx'
                  Domain: 'linktype_rmi_slreq'
                Revision: 5
                   Dirty: 0
    CustomAttributeNames: {}

Export the link set to a new file that is compatible with MATLAB R2020a. Name the new file crs_req_2020a.

tf = exportToVersion(myLinkSet,"crs_req_2020a","R2020a")
tf = logical


  • If the link set contains links to Model-Based Design artifacts, you might also need to export the artifacts to a previous version for the links to be resolved. For more information, see Export Link Sets.

  • You can export a requirement set to a previous version with slreq.ReqSet.exportToVersion.

Version History

Introduced in R2018a