Main Content

save

Class: slreq.LinkSet
Namespace: slreq

Save link set

Description

example

tf = save(myLinkSet) saves the link set specified by myLinkSet with the default file name, which is the name and extension of the source artifact, separated by a tilde. For more information, see Link Storage.

example

tf = save(myLinkSet,filePath) saves the link set specified by myLinkSet with the file name and path specified by filePath.

Input Arguments

expand all

Link set, specified as an slreq.LinkSet object.

File name and path of the link set, specified as a string scalar or character vector. You can specify either the full file path and file name or just the file name. If you only specify a file name, you do not need to include the extension.

Example: "C:\MATLAB\myLinkSet.slmx"

Example: "myLinkSet"

Output Arguments

expand all

Save success status, returned as a 1 or 0 of data type logical.

Examples

expand all

This example shows how to save link sets.

Load the basicReqSet requirement set.

rs = slreq.load("basicReqSet");

Get a handle to the first two requirements in the requirement set.

req1 = find(rs,Index=1);
req2 = find(rs,Index=2);

Create a link between the two requirements.

myLink = slreq.createLink(req1,req2);

Get a handle to the link set.

myLinkSet = linkSet(myLink);

Save the link set with the default file name and path.

tf = save(myLinkSet)
tf = logical
   1

Get the file name of the link set.

[filepath,name,ext] = fileparts(convertCharsToStrings(myLinkSet.Filename));
linkSetName = name+ext
linkSetName = 
"basicReqSet~slreqx.slmx"

This example shows how to save link sets and specify the file name and path of the link set.

Load the basicReqSet requirement set.

rs = slreq.load("basicReqSet");

Get a handle to the first two requirements in the requirement set.

req1 = find(rs,Index=1);
req2 = find(rs,Index=2);

Create a link between the two requirements.

myLink = slreq.createLink(req1,req2);

Get a handle to the link set.

myLinkSet = linkSet(myLink);

Save the link set in the current folder with the name basicReqSet.

tf = save(myLinkSet,"basicReqSet")
tf = logical
   1

Version History

Introduced in R2018a

See Also

Classes

Functions