Main Content

exportToVersion

Class: slreq.LinkSet
Namespace: slreq

Export link set to previous MATLAB version

Syntax

tf = exportToVersion(myLinkSet,name,version)

Description

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.

Note

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

Examples

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 ShortestPath project. Load the shortest_path_func_reqs requirement set, which also loads the shortest_path link set.

openProject("ShortestPath");
slreq.load("shortest_path_func_reqs");

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

myLinkSet = slreq.find("Type","LinkSet","Name","shortest_path");

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

tf = exportToVersion(myLinkSet,"shortest_path_20a","R2020a")
tf = logical
   1

Tips

  • 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 by using the exportToVersion method of slreq.ReqSet.

Version History

Introduced in R2018a