主要内容

deleteSubtree

R2026b

Delete subtree in fault tree document

Since R2026b

Description

deleteSubtree(faultTreeDocument,gateLabel) deletes the subtree under the gate with the label gateLabel in the fault tree document, faultTreeDocument.

example

deleteSubtree(faultTree,gateLabel) deletes the subtree under the gate with the label gateLabel in the fault tree, faultTree.

example

Examples

collapse all

Create a new fault tree document in the Safety Analysis Manager.

myTreeDoc = safetyAnalysisMgr.newDocument("fault-tree");

Create a tree that has two basic events from the top-level gate, and an OR gate that has two basic events.

myTopGate = myTreeDoc.Gates(1);
event1 = createEvent(myTopGate);
event2 = createEvent(myTopGate);
myOtherGate = createGate(myTopGate);
event3 = createEvent(myOtherGate);
event4 = createEvent(myOtherGate);

Delete the subtree under the myOtherGate gate in the myTreeDoc fault tree document.

deleteSubtree(myTreeDoc,myOtherGate.Label)

Create a new fault tree document in the Safety Analysis Manager and get the FaultTree object.

myTreeDoc = safetyAnalysisMgr.newDocument("fault-tree");
myFaultTree = myTreeDoc.FaultTrees(1);

Create a tree that has two basic events from the top-level gate, and an OR gate that has two basic events.

myTopGate = myFaultTree.Gates(1);
event1 = createEvent(myTopGate);
event2 = createEvent(myTopGate);
myOtherGate = createGate(myTopGate);
event3 = createEvent(myOtherGate);
event4 = createEvent(myOtherGate);

Delete the subtree under myOtherGate in the myFaultTree fault tree.

deleteSubtree(myFaultTree,myOtherGate.Label)

Input Arguments

collapse all

Fault tree document in the Safety Analysis Manager, specified as a FaultTreeDocument object.

Fault tree in the Safety Analysis Manager fault tree document, specified as a FaultTree object.

Gate label, specified as a string scalar or character vector. To retrieve the gate label, you can retrieve the Label property from the Gate object by using dot notation.

Data Types: char | string

Version History

Introduced in R2026b