Contenuto principale

createGate

R2026b

Add gate to gates in fault tree

Since R2026b

Description

newGate = createGate(gate) creates an OR gate and adds it to the gate, gate, in the Safety Analysis Manager fault tree.

example

newGate = createGate(gate,Name=Value) creates a gate using one or more name-value arguments.

example

Examples

collapse all

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);

Get the gate that corresponds to the top-level gate of the tree.

myTopGate = myFaultTree.Gates(1);

Add an OR gate to the top-level gate.

myNewGate = createGate(myTopGate);

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);

Get the gate that corresponds to the top-level gate of the tree.

myTopGate = myFaultTree.Gates(1);

Add an AND gate to the top-level gate.

myNewGate = createGate(myTopGate,Type="and");

Input Arguments

collapse all

Gate in the Safety Analysis Manager fault tree document, specified as a Gate 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: myGate = createGate(myOtherGate,Type="and") adds an AND gate to the gate, myOtherGate.

Gate description, specified as a string scalar or character vector.

Data Types: string | char

Gate label, specified as a string scalar or character vector. If you do not specify this name-value argument, the gate uses the predefined top-level gate label, GATE. Additional gates that use the default label are labeled GATEN, where N increments as you create additional gates.

Data Types: string | char

Gate type, specified as one of these options:

ValueDescription
"or"A logical OR gate that calculates the intersection of the input unavailabilities and frequencies.
"and"A logical AND gate that calculates the union of the input unavailabilities and frequencies.
"not"A logical NOT gate that calculates 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"A logical exclusive OR gate that calculates the probability that only one event occurs. You can specify only two inputs to this gate.
"voting"A voting algorithm that calculates the probability that the specified number of the inputs or more occurs. To specify the number of inputs that must be true, define the k property in the FailureProperties object assigned to this gate.

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

Data Types: enumeration

Output Arguments

collapse all

New gate in the fault tree, returned as a Gate object.

Version History

Introduced in R2026b