Main Content

Save requirements traceability data in external .req file


example saves requirements traceability data for a model in an external .req file. The model must be configured to store requirements traceability data externally. This function is equivalent to Save > Save Links Only in the Requirements tab.


collapse all

Add a requirement link to an existing example model, and save the model requirements traceability data in an external file.

Open a model called slvnvdemo_powerwindowController.


Specify that the model store requirements data externally.


Create a new requirements link structure.

newReqLink = rmi('createEmpty');
newReqLink.description = 'newReqLink';

Specify the requirements document that you want to link to from the model. In this case, an example requirements document is provided.

newReqLink.doc = [matlabroot '\toolbox\slvnv\rmidemos\' ...

Specify the text of the requirement within the document to which you want to link. = ['?passenger input consists of a vector' ...
'with three elements'];

Specify that the new requirements link that you created be attached to the Mux4 block of the slvnvdemo_powerwindowController example model.

rmi('set', 'slvnvdemo_powerwindowController/Mux4', newReqLink);

Save the new requirement link that you just created in an external .req file associated with the model.'slvnvdemo_powerwindowController');

This function is equivalent to Save > Save Links Only in the Requirements tab.

To highlight the Mux4 block, turn on requirements highlighting for the slvnvdemo_powerwindowController example model.

rmi('highlightModel', 'slvnvdemo_powerwindowController');

You can test your requirements link by right-clicking the Mux4 block. In the context menu, select Requirements > 1. “newReqLink”.

Close the example model.

close_system('slvnvdemo_powerwindowController', 0);

You are not prompted to save unsaved changes because you saved the requirements link data outside the model file. The model file remains unchanged.

Input Arguments

collapse all

Name of model with requirements links, specified as a character vector, or handle to model with requirements links. The model must be loaded into memory and configured to store requirements traceability data externally.

If you have a new model with no existing requirements links, configure it for external storage as described in Requirements Link Storage. You can also use the rmipref command to specify storage settings.

If you have an existing model with internally stored requirements traceability data, convert that data to external storage as described in Move Internally Stored Requirements Links to External Storage. You can also use the rmidata.export command to convert existing requirements traceability data to external storage.

Example: 'slvnvdemo_powerwindowController'

Example: get_param(gcs,'Handle')

Introduced in R2013b