主要内容

createFaultTree

R2026b

Create fault tree in fault tree document

Since R2026b

Description

faultTree = createFaultTree(faultTreeDocument) creates a new fault tree in the Safety Analysis Manager fault tree document faultTreeDocument. The top-level gate is an OR gate. You can add multiple fault trees to a document.

example

faultTree = createFaultTree(faultTreeDocument,Name=Value) creates a new fault tree in the Safety Analysis Manager fault tree document by using one or more name-value arguments.

example

Examples

collapse all

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

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

The new document contains one fault tree. Create another fault tree.

myNewTree = createFaultTree(myTreeDoc)
myNewTree = 

  FaultTree with properties:

            Gates: [1×1 safetyAnalysisMgr.Gate]
    TransferGates: [1×0 safetyAnalysisMgr.TransferGate]

Retrieve both trees in the fault tree document.

myTrees = myTreeDoc.FaultTrees;
myTrees = 

  1×2 FaultTree array with properties:

    Gates
    TransferGates

Input Arguments

collapse all

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

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: myFaultTree = createFaultTree(myFaultTreeDoc,Type="and") adds a fault tree to the fault tree document, myFaultTreeDoc, where the top-level gate is an AND gate.

Description of top-level fault tree gate, specified as a string scalar or character vector.

Data Types: string | char

Label of the top-level fault tree gate, specified as a string scalar or character vector. If you do not specify this name-value argument, the fault tree uses the default gate label, GATE. Additional gates have the name GATEN, where N increments as you create additional gates.

Data Types: string | char

Type of top-level fault tree gate, specified as one of these options:

ValueDescription
"or"OR gates calculate the union of the input unavailabilities and frequencies.
"and"AND gates calculate the intersection of the input unavailabilities and frequencies.
"not"NOT gates calculate the probability that an input does not occur. For example, if the input probability is 1, the not gate returns a probability of 0. You can specify only one input to this gate.
"xor"XOR gates calculate the probability that only one event occurs. You can specify only two inputs to this gate.
"voting"Voting gates calculate the probability that the specified number of the inputs or more occurs.

This argument value is case insensitive. For more information on gates, see Create Fault Tree Gates.

Data Types: enumeration

Output Arguments

collapse all

New fault tree in the fault tree document, returned as a FaultTree object.

Tips

  • To reuse fault trees in other fault trees, use transfer gates. To create a transfer gate, use the createTransferGate function.

Version History

Introduced in R2026b