Main Content

navigate

Navigate to changed artifact from detected change in Safety Analysis Manager document

Since R2024b

Description

navigate(detectedChange) navigates to the changed artifact associated with the specified detected change.

This function requires Requirements Toolbox™.

example

Examples

collapse all

Open the example and the project.

openExample('faultanalyzer/ChangeTrackingSpreadsheetExample')
openProject("EvaluateFaultsFuelSystemProject");

The example contains a model and a Safety Analysis Manager spreadsheet that does not have links or faults. Open the sldemo_fuelsys_fault_analyzer model and the FuelSysFMEA.mldatx spreadsheet. Create the faults and the links between the faults and the spreadsheet by using the fuelSysFaultSetupProject helper function.

mdl = "sldemo_fuelsys_fault_analyzer";
open_system(mdl);
FMEAName = safetyAnalysisMgr.openDocument("FuelSysFMEA.mldatx");
fuelSysFaultSetupProject

Get the fault from the model on the third input port of the To Controller subsystem by using the Simulink.fault.findFaults function.

myFault = Simulink.fault.findFaults(...
mdl,ModelElement=mdl + "/To Controller/Inport/3");

Set the trigger time of the fault to 10 by changing the Fault object property values and save the fault information by using the Simulink.fault.save function.

myFault.StartTime = 10;
Simulink.fault.save(mdl)

Detect the changes to the linked artifact in the FuelSysFMEA.mldatx spreadsheet by using the detectChanges function on the spreadsheet, and retrieve the ChangeInformation objects of the changes.

detectChanges(FMEAName)
myChanges = getChanges(FMEAName);

View the fault in the model associated with the first change.

navigate(myChanges(1))

Input Arguments

collapse all

Detected change in the Safety Analysis Manager document, returned as a ChangeInformation object.

Version History

Introduced in R2024b