Main Content


Class: slreq.ReqSet
Package: slreq

Get contents of PostLoadFcn callback


callback = getPostLoadFcn(rs)


callback = getPostLoadFcn(rs) returns the contents of the PostLoadFcn callback for the requirement set rs.

Input Arguments

expand all

Requirement set, specified as an slreq.ReqSet object.

Output Arguments

expand all

Contents of the PostLoadFcn callback script for the requirement set, returned as a character vector.


expand all

This example shows how to get and set the PostLoadFcn callback for a requirement set.

Add the current folder to the path.


Open a project that contains an algorithm to calculate the shortest path between two nodes on a graph. For more information, see Verify a MATLAB Algorithm by Using Requirements-Based Tests.


Open the shortest_path_tests_reqs requirement set. The requirement set contains test requirements that describe the functional behavior that must be tested by a test case in order to verify the shortest_path algorithm in the project.

testReqs ="shortest_path_tests_reqs");

Register the postLoadTestReqs script as the PostLoadFcn callback.


Confirm that the postLoadTestReqs script is the PostLoadFcn callback for the shortest_path_tests_reqs requirement set.

callbackScript = getPostLoadFcn(testReqs)
callbackScript = 

Save and close the shortest_path_tests_reqs requirement set, then re-open the requirement set. The PostLoadFcn callback executes.

testReqs = slreq.load("shortest_path_tests_reqs");

The postLoadTestReqs script opens the test file associated with the test requirements, graph_unit_tests.m and imports the Requirements Editor view settings from myViewSettings.mat.

type postLoadTestReqs.m

Version History

Introduced in R2022a