主要内容

createEvent

R2026b

Add event to fault tree document or gate

Since R2026b

Description

event = createEvent(faultTreeDocument) adds a basic event to the Safety Analysis Manager fault tree document, faultTreeDocument. To use the event in the fault tree, assign it to a gate by using the addEvent function.

example

event = createEvent(gate) adds a basic event to the gate, gate.

example

event = createEvent(___,Name=Value) adds an event 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");

Create a basic event in the document.

myEvent = createEvent(myTreeDoc)
myEvent = 

  Event with properties:

            Type: 'basic'
           Label: 'EVENT1'
     Description: ''
    FailureModel: [1×1 safetyAnalysisMgr.FailureModel]

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

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

New fault tree documents contain one fault tree that has one top-level gate. Get the top-level gate and add a basic event to it.

myTopGate = myTreeDoc.Gates(1);
myEvent = createEvent(myTopGate);

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

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

Get the top-level gate and add a house event to it.

myTopGate = myTreeDoc.Gates(1);
myEvent = createEvent(myTopGate,Type="house");

Input Arguments

collapse all

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

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: myEvent = createEvent(myGate,Type="house") adds a house event to the gate, myGate.

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

Data Types: string | char

Event label, specified as a string scalar or character vector. If you do not specify this name-value argument, the event uses the default top-level gate label, EVENT. Additional events have the name EVENTN, where N increments as you create additional events.

Data Types: string | char

Event type, specified as one of these values:

ValueDescription
"basic"The starting point of failure in the tree.
"undeveloped"Events whose contribution to the design are unknown. These events may require additional details or are trivial.
"house"Events that either occur or do not occur.

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

Data Types: enumeration

Output Arguments

collapse all

New fault tree document event, returned as an Event object. Each event must have a unique name.

Version History

Introduced in R2026b