Main Content

exportToVersion

Class: slreq.ReqSet
Package: slreq

Export requirement set to previous MATLAB version

Syntax

tf = exportToVersion(rs,name,version)

Description

tf = exportToVersion(rs,name,version) saves a copy of the requirement set rs with the file name name that is compatible with the MATLAB® version version. The function returns 1 if the file exports. The function saves the file in the current folder. If the requirement set has an associated link set, exportToVersion also exports the link set and saves it in the current folder.

Note

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

Input Arguments

expand all

Requirement set, specified as an slreq.ReqSet object.

File name for the exported requirement 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(rs,"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 requirement set to a file that is compatible with a previous version of MATLAB.

Open the Requirements Definition for a Cruise Control Model project and load the crs_req requirement set.

slreqCCProjectStart;
rs = slreq.load("crs_req");

Export the requirement set to a new file that is compatible with MATLAB R2020a. Name the new file crs_req_2020a. The exportToVersion function also exports the link set associated with the requirement set using the same file name.

tf = exportToVersion(rs,"crs_req_2020a","R2020a")
tf = logical
   1

Cleanup

Clear the open requirement sets and link sets. Close the current project.

slreq.clear;
close(currentProject);

Tips

Version History

Introduced in R2018a