Main Content

getAssociatedModel

R2026b

Retrieve name of model fault

Since R2023b

Description

name = getAssociatedModel(fault) returns the name of the model that contains the fault, fault.

example

name = getAssociatedModel(conditional) returns the name of the model that contains the conditional, conditional.

example

Examples

collapse all

Open the fault_analyzer_intro model.

openExample("faultanalyzer/FaultAnalyzerIntroExample")

Add a fault to the Sine Wave block output port.

myFault = Simulink.fault.addFault(...
"fault_analyzer_intro/Sine Wave/Outport/1");

Retrieve the name of the model that contains the fault.

myModel = getAssociatedModel(myFault);

Open the fault_analyzer_intro model.

openExample("faultanalyzer/FaultAnalyzerIntroExample")

Add a conditional named myConditional with the expression y1 >= 0.

faultConditional = Simulink.fault.addConditional(...
"fault_analyzer_intro","myConditional","y1 >= 0");

Retrieve the name of the model that contains the conditional.

myModel = getAssociatedModel(faultConditional);

Input Arguments

collapse all

Fault, specified as a Fault object.

Conditional, specified as a Conditional object.

Output Arguments

collapse all

Name of the model that contains the fault or conditional, returned as a character vector.

Version History

Introduced in R2023b

See Also

Objects

Functions