Save requirements traceability data in external .req file
Add a requirement link to an existing example model, and save the model requirements traceability data in an external file.
Open the example model, 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\' ... 'powerwin_reqs\PowerWindowSpecification.docx'];
Specify the text of the requirement within the document to which you want to link.
newReqLink.id = '?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.
This function is equivalent to the Simulink Editor option Analysis > Requirements > Save Links.
To highlight the Mux4 block, turn on requirements highlighting for the slvnvdemo_powerwindowController example model.
You can test your requirements link by right-clicking the Mux4 block. In the context menu, select Requirements > 1. "newReqLink".
Close the example model.
You are not prompted to save unsaved changes because you saved the requirements link data outside the model file. The model file remains unchanged.
Name of model with requirements links, specified as a string, 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 Specify Storage for Requirements Links. You can also use the rmidata.default 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.